// I put arguments.length = 0 || null and i want to get 0 at final , but at this case it doesn't work and it returns undefined. what's wrong??
function mostNumbers(numbers){
for (var i = 0; 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 || arguments.length ===null ) return 0;
return result = x - y ;
}
}
console.log (mostNumbers() );
// I put arguments.length = 0 || null and i want to get 0 at final , but at this case it doesn't work and it returns undefined. what's wrong??
function mostNumbers(numbers){ for (var i = 0; i < arguments.length; ++i) { let args = Array.prototype.slice.call(arguments); let x = Math.max(...args) ; let y = Math.min(...args); let result;