• The most numbers, elementary

Question related to mission The Most Numbers

 

Hey!! My solution works only if i = -1, but if I put i = 0 it doesn't work! Could you explain me what's wong here?

  function mostNumbers(numbers){
      for (var i = -1; i < arguments.length; ++i) {
           let args = Array.prototype.slice.call(arguments);
   let x = Math.max(...args) ;
          let y = Math.min(...args);
          let result;

   if (arguments.length == 0)  return 0;          
     return result = x - y  ;


      }
  }


  console.log (mostNumbers());