For example, consider below sample code.
test1= "test1"/2;
Since dividing a string value with a numeric value is undefined, the division will return as "NaN". i-e alert(test1); will show "NaN".
We can not compare this "NaN" with any other number, so we need a special function for verifying it. isNaN() will be used for doing this test.
It will return "false" if the value is number, otherwise it will return "true" if it is not a number.
Properties of Math object can be used for getting math constants in javascript.
For example Math.PI will return value(3.14...) of PI.
More Articles...
No comments:
Post a Comment