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

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

The code will produce the following output −

10
typescript_numbers.htm
Advertisements