How can I check that a variable is a number, either an integer or a string digit?
In PHP I could do:
if (is_int($var)) { echo \'$var is integer\'
Be aware that empty string '' and ' ' will be considered as number by isNaN and isFinite.
''
' '
isNaN
isFinite