Originally Posted by Airblader
isNaN(x) or parseInt(x) == x doesn't check if x is a number/integer, it just checks if x has a value representing a number/integer (it may very well actually be a string). This could or could not be the intended behavior, so I'm just pointing it out.
In that case you could use:
if (x === +x)
which will only return true if x actually is a number and not just something that can be converted to a number.
Helping others to solve their computer problem at http://www.felgall.com/