Challenge "Where do I belong", only one thing left

Challenge "Where do I belong", only one thing left
0

#1

Hello! What did I do wrong? Only the last string left. Results

function getIndexToIns(arr, num) {
 var args = Array.prototype.slice.call(arguments);
  args.splice(0,1);
   var m = arr.sort(function(a , b){
 return a - b; 
});
  
  for(var i = 0; i < arr.length; i++){
    if(args <= arr[i] ){
     return i;
    }
    
  }
   
}
 

getIndexToIns([2, 5, 10], 15);

#2

Your code doesn’t take care of cases where num belongs to the end of the array.