Is there any difference between $.isNumeric and !isNaN()
?
I don\'t see where they will ever return different results.
As PeeHaa says, $.isNumeric()
checks whether the value is a number or can be converted to a number, isNaN()
checks strictly only whether the value is NaN
.
Here's a handy comparison chart that uses the jQuery documentation's examples (comparing $.isNumeric()
to !isNaN
for easier comparison): http://jsfiddle.net/eghE9/