- TypeScript Tutorial
- TypeScript - Home
- TypeScript - Overview
- TypeScript - Environment Setup
- TypeScript - Basic Syntax
- TypeScript - Types
- TypeScript - Variables
- TypeScript - Operators
- TypeScript - Decision Making
- TypeScript - Loops
- TypeScript - Functions
- TypeScript - Numbers
- TypeScript - Strings
- TypeScript - Arrays
- TypeScript - Tuples
- TypeScript - Union
- TypeScript - Interfaces
- TypeScript - Classes
- TypeScript - Objects
- TypeScript - Namespaces
- TypeScript - Modules
- TypeScript - Ambients
- TypeScript Useful Resources
- TypeScript - Quick Guide
- TypeScript - Useful Resources
- TypeScript - Discussion
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
To Continue Learning Please Login
Login with Google