For the sake of argument

by Igor Cuckovic

JavaScript

/* 
Write a function named numbers that returns true if all the parameters it is passed are numbers. Otherwise, the function should return false. The function should accept any number of parameters.
*/

function numbers() {
  if (arguments.length === 0 || arguments[0] === null) return false;
  for (var i in arguments) {
    if (typeof arguments[i] === 'string') return false;
  }
  return true;
}

console.log(numbers(1, 4, 3, 2, 5)); // true
console.log(numbers(1, "a", 3)); // false
console.log(numbers()); // false