X
HOME HTML5 CSS3 JAVASCRIPT SQL PHP5 JQUERY ANGULAR BOOTSTRAP3 XML MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

JavaScript Number valueOf() Method

JavaScript Number Reference JavaScript Number Reference

Example

Return the primitive value of a number:

var num = 15;
var n = num.valueOf();

The result of n will be:


Try it yourself »


Definition and Usage

The valueOf() method returns the primitive value of a number.


Browser Support

Method
valueOf() Yes Yes Yes Yes Yes


Syntax

number.valueOf()

Parameters

None

Technical Details

Return Value: A Number, representing the primitive value of a number
JavaScript Version: 1.1


JavaScript Number Reference JavaScript Number Reference

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE

facebook