NUMBER OBJECT:
The Number object represents numerical date,
either integers or floating-point numbers.
The syntax for creating
a number object is as follows:
var val = new Number(number);
In the place of number, if
you provide any non-number argument, then the argument cannot be converted into
a number, it returns NaN (Not-a-Number).
Number properties:
- MAX_VALUE- The largest possible value a number in JavaScript can have
- MIN_VALUE- The smallest possible value a number in JavaScript
- NAN- Equal to a value that is not a number.
- NEGATIVE_INFINITY- A value that is less than MIN_VALUE
- POSITIVE_ INFINITY- A value that is greater than MAX_VALUE
Methods:
1.valueOf()-Returns the
number's value.
2.toString()-Returns the
string representation of the number's value
3.toFixed()-Formats a
number with a specific number of digits to the right of the decimal.
No comments:
Post a Comment