The combination of IsNaN and isFinite methods are used to confirm whether an argument is a number or not.
function isNumber(n) { return !isNaN(parseFloat(n)) && isFinite(n); }