My Binary Search Implementation
Just focusing on the initialization part.


The code is using both index and idx which gives off a code smell, something could be better there
The code is using idx just to loop over an array, apply a function and push. We can do better than this
Comments should be useful, commenting the end of an if statement is not useful

(function(){
  process.argv.forEach(function (val, index, array) {

    try{
      //Add the comma separated numbers to myArray as integers    
      if(index === 2){
        myArray = myArray.concat( val.split(",").map(c=&gt;parseInt(c)) );
      } else if (index === 3){
        //Third index is the number to be searched.
        searchNum = parseInt(val)
      }
    }catch(e){
      console.log(e)
    }
  });
})();



If you think further, then we could skip the whole loop business, and just access the 2 values we need. It would be simpler, and better.

    (function(){
      var args = process.argv;

      try{
        //Add the comma separated numbers to list as integers    
        list = list.concat( args[2].split(",").map(c=&gt;parseInt(c)) );
        //Third index is the number to be searched.
        searchNum = parseInt( args[3] );
      }catch(e){
        console.log(e)
      }
    })();


myArray is not a great name, I preferred list.