Write a Script in JavaScript for Different OS systems for Adobe Premiere Pro

I am creating a script for Windows and MacOS.
How better I should create a script to run in different OS?

I wrote a function

function osCheck() {

var os = $.os;
var match = os.indexOf("Windows");

if(match !=-1){
    var userOS = "PC";
 } else {
     var userOS = "MAC";
    }
     return userOS;

}

but I think it will does not wor for my script.
My script creating a Bin and Sequence in Adobe Premiere Pro.

$.runDigital = {
digital: function() {

    var rootItem = app.project.rootItem
    var sequenceBin = rootItem.createBin('01_EDIT')

        app.enableQE();
        //create new seq for windows
        qe.project.newSequence("_EDIT_", "C:\Program Files\Adobe\Adobe Premiere Pro 2022\Settings\SequencePresets\DNxHD\1080p 25\DNX LB 1080p 25.sqpreset" );

        //create new seq for Mac
        qe.project.newSequence("_EDIT_", "/Applications/Adobe Premiere Pro 2022/Adobe Premiere Pro 2022/Contents/Settings/SequencePresets/DNxHD/1080p 25/DNX LB 1080p 25.sqpreset" );

        rootItem.children[1].moveBin(sequenceBin);