Our volunteers haven't translated this article into हिन्दी (भारत) yet. Join us and help get the job done!
You can also read the article in English (US).

The valueOf() method returns the wrapped primitive value of a Number object.



Return value

A number representing the primitive value of the specified Number object.


This method is usually called internally by JavaScript and not explicitly in web code.


Using valueOf

var numObj = new Number(10);
console.log(typeof numObj); // object

var num = numObj.valueOf();
console.log(num);           // 10
console.log(typeof num);    // number


Specification Status Comment
ECMAScript 1st Edition (ECMA-262) Standard Initial definition. Implemented in JavaScript 1.1.
ECMAScript 5.1 (ECMA-262)
The definition of 'Number.prototype.valueOf' in that specification.
ECMAScript 2015 (6th Edition, ECMA-262)
The definition of 'Number.prototype.valueOf' in that specification.
ECMAScript Latest Draft (ECMA-262)
The definition of 'Number.prototype.valueOf' in that specification.

Browser compatibility

Update compatibility data on GitHub
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetNode.js
valueOfChrome Full support YesEdge Full support YesFirefox Full support 1IE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yesnodejs Full support Yes


Full support  
Full support

See also

दस्तावेज़ टैग और योगदानकर्ता

इस पृष्ठ के लिए योगदानकर्ता: mdnwebdocs-bot, alattalatta, wbamberg, fscholz, jameshkramer, eduardoboucas, ziyunfei, Mingun, ethertank, Sheppy, evilpie, Waldo, Potappo, Mgjbot
अंतिम अद्यतन: mdnwebdocs-bot,