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: Feb. 14, 2020, 5:16 p.m.; Updated at: Feb. 16, 2020, 8:38 p.m.
The question is resolved.