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());
Created at: 2020/02/14 17:16; Updated at: 2020/02/16 20:38
The question is resolved.