Number.prototype
Number.prototype
屬性用來表示 Number
建構式的原型。
Property attributes of Number.prototype |
|
---|---|
Writable | no |
Enumerable | no |
Configurable | no |
說明
屬性
Number.prototype.constructor
- 回傳建立這個物件實體的建構式。預設為
Number
物件。
方法
Number.prototype.toExponential()
- 回傳以「科學記數法」表示的數值字串。
Number.prototype.toFixed()
- 回傳以定點表示的數值字串。
Number.prototype.toLocaleString()
(en-US)- 回傳以當地語言為主的數值字串。這覆寫
Object.prototype.toLocaleString()
(en-US) 的方法。 Number.prototype.toPrecision()
(en-US)- 回傳以定點或科學記數表示的數值字串。
Number.prototype.toSource()
(en-US) Non-Standard- Returns an object literal representing the specified
Number
object; you can use this value to create a new object. Overrides theObject.prototype.toSource()
(en-US) method. Number.prototype.toString()
(en-US)- 回傳以特定基數表示的數值字串。這覆寫
Object.prototype.toString()
(en-US) 的方法 。 Number.prototype.valueOf()
(en-US)- 回傳這個物件的原始型別,即原始數值。這覆寫
Object.prototype.valueOf()
(en-US) 。
規範
規範 | 狀態 | 註記 |
---|---|---|
ECMAScript 1st Edition (ECMA-262) | Standard | Initial definition. Implemented in JavaScript 1.1. |
ECMAScript 5.1 (ECMA-262) The definition of 'Number' in that specification. |
Standard | |
ECMAScript 2015 (6th Edition, ECMA-262) The definition of 'Number' in that specification. |
Standard | |
ECMAScript (ECMA-262) The definition of 'Number' in that specification. |
Living Standard |
瀏覽器相容性
No compatibility data found for javascript.builtins.Number.prototype
.
Check for problems with this page or contribute missing data to mdn/browser-compat-data.