TypeScript – Number valueOf()

 value of

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());

On compiling, it will generate the same code in JavaScript.

The code will produce the following output −

10

Previous Page:-Click Here

Leave a Reply