I'm trying to write a simple test for the input of a function to determine if all of the inputs are numbers or not.
function numbers(){
for (var i = 0; i < arguments.length; i++) {
if (isNaN(arguments[i])) return false;
}
return true;
}
However, when I pass in a list of numbers as characters (eg. numbers("1", "2")) I get true
instead of the expected false
.