Post Link : Check If Variable Is A Number In JavaScript
This tutorial explains how to check variable is a number in javascript. Lets see the belo...
For further actions, you may consider blocking this person and/or reporting abuse
Hey there skptricks!
I stumbled upon this while writing my own and wanted to point out something.
You cannot rely on
isNaN()
for checking if something is a number. You can use it to check if the input provided toisNaN()
will cause furtherNaN
values. If that makes sense.Using it the way you have,
true
andfalse
will result intrue is a number.
Here's a function I wrote to check if something is a number: codepen.io/grok/pen/LvOQbW?editors...