How to use Number valueOf() method to convert number to primitive in Javascript
Description
The valueOf()
method returns the primitive numeric value represented by the object.
Example
var numberObject = new Number(10);
console.log(numberObject.valueOf());
The code above generates the following result.