Over a million developers have joined DZone.

JavaScript IsNumber Function

·
JavaScript function that determines if a variable is an actual Number object and not NaN or +/- Infinity.


function isNumber(x) 
{ 
  return ( (typeof x === typeof 1) && (null !== x) && isFinite(x) );
}
Topics:

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}