ES6 - valueOf()



This method returns the primitive value of the specified number object.

Syntax

number.valueOf()

Return value

Returns the primitive value of the specified Number object.

Example

var num = new Number(10);
console.log(num.valueOf());

Output

10
Advertisements