Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Number.prototype

La propietat Number.prototype representa el prototipus per al constructor Number.

Property attributes of Number.prototype
Writable no
Enumerable no
Configurable no

Descripció

Totes les instàncies de Number hereten de Number.prototype. L'objecte prototipus del constructor de Number pot ser modificat per a afectar totes les instàncies de Number.

Propietats

Number.prototype.constructor
Retorna la funció que ha creat la instància d'aquest objecte. Per defecte aquesta és l'objecte Number.

Mètodes

Number.prototype.toExponential()
Retorna un string que representa el nombre en notació exponencial.
Number.prototype.toFixed()
Retorna un string que representa el nombre en notació de punt fixe.
Number.prototype.toLocaleString()
Retorna un string amb una representació d'aquest nombbre sensible a la llengua. Sobreescriu el mètode Object.prototype.toLocaleString().
Number.prototype.toPrecision()
Retorna un string amb una representació de precisió de punt fixe o notació exponencial del nombre.
Number.prototype.toSource()
Retorna un objecte literal que representa l'objecte Number especificat; aquest valor pot ser emprat per a crear un nou objecte. Sobreescriu el mètode Object.prototype.toSource().
Number.prototype.toString()
Retorna un string que representa l'objecte especificat en el radi (base) especificat. Sobreescriu el mètode Object.prototype.toString().
Number.prototype.valueOf()
Retorna el valor primitiu de l'objecte especificat. Sobreescriu el mètode Object.prototype.valueOf().

Especificacions

Especificació Estat Comentaris
ECMAScript 1st Edition (ECMA-262) Standard Definició inicial. Implementat a 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  

Compatibilitat amb navegadors

Característica Chrome Firefox (Gecko) Internet Explorer Opera Safari
Suport bàsic (Yes) (Yes) (Yes) (Yes) (Yes)
Característica Android Chrome for Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Suport bàsic (Yes) (Yes) (Yes) (Yes) (Yes) (Yes)

Vegeu també

Document Tags and Contributors

 Contributors to this page: enTropy
 Last updated by: enTropy,