I\'m doing some trouble-shooting and want to add a check that a parameter to a function is a number. How do I do this?
Something like this...
function fn
function fn(id) { return typeof(id) === 'number'; }
To also check if it’s an integer:
function fn(id) { return typeof(id) === 'number' && isFinite(id) && Math.round(id) === id; }