parseInt("Hello",10);//return NAN
parseInt("110",10);//return 110
So a simple way to determine whether a string is a number is to use isNaN(). If true is returned, then the character The string is not a number, otherwise it is a number
isNaN(parseInt( "Hello",10));//true;
isNaN(parseInt("110",10));//false;
Note: You cannot use the following method to judge:
parseInt("Hello",10)==NaN;// return false
parseInt("110",10)==NaN;//return false
Because NaN and itself do not want to wait, this is quite special. The way to judge NaN is isNaN() ;