JavaScript Number valueOf() method
- 上一页 toString()
- 下一页 constructor
- 返回上一层 Manueli JavaScript Number
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.
Throw
Exception | Description |
---|---|
TypeError | An exception is thrown when the object called by the method is not Number. |
browser supports
valueOf()
是 ECMAScript1 (ES1) 特性。
所有浏览器都完全支持 ES1 (JavaScript 1997):
Chrome | IE | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
Chrome | IE | Edge | Firefox | Safari | Opera |
支持 | 支持 | 支持 | 支持 | 支持 | 支持 |
- 上一页 toString()
- 下一页 constructor
- 返回上一层 Manueli JavaScript Number