JavaScript Number valueOf() method
- Previous Page toString()
- Next Page constructor
- Go to the Previous Level JavaScript Number Reference Manual
Definition and usage
valueOf()
The method returns the original value of the number.
Syntax
number.valueOf()
Parameter
No parameters.
Return value
Type | Description |
---|---|
Number | The original value of the number. |
Technical details
Return value
number The original value. There is almost no need to explicitly call this method.
Thrown
Exception | Description |
---|---|
TypeError | An exception is thrown if the object that calls this method is not a Number. |
Browser support
valueOf()
It is an ECMAScript1 (ES1) feature.
All Browsers Fully Support ES1 (JavaScript 1997):
Chrome | IE | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
Chrome | IE | Edge | Firefox | Safari | Opera |
Support | Support | Support | Support | Support | Support |
- Previous Page toString()
- Next Page constructor
- Go to the Previous Level JavaScript Number Reference Manual