sarathkumar M
sarathkumar M

Reputation: 3

How to find Number object inside type

Number object in javascript accept all type of numbers like integer,float,hexadecimal,etc.

How to find number object inside type of number? like that number integer or hexa decimal

var num = new Number(23.456);
console.log(typeof(num)) //output:object

but i want to see number of value type

how to find?

Upvotes: 0

Views: 67

Answers (1)

Barmar
Barmar

Reputation: 780843

Use the valueOf() method to get the numeric value.

var num = new Number(23.456);
console.log(typeof(num.valueOf())) //output: number

Upvotes: 1

Related Questions