Skip to main content

Command Palette

Search for a command to run...

Data type in JavaScript

Updated
•1 min read•View as Markdown
Data type in JavaScript

data type in javascript is fun.

to find out the maximum and minimum value of a number you should write as well as like this...

here as you can see that i have took a nn variable & assigned its value. but you will get two different number of MAX_VALUE of 45.45 & MAX_SAFE_INTEGER 45.45.
when you write the code you will get its MAX_VALUE is 1.7976931348623157e+308.

and MAX_SAFE_INTEGER is 9007199254740991.

its happened because MAX_VALUE & MAX_SAFE_INTEGER isn't same.thats why its return different type of data.

as well as you will get also the same for MIN_VALUE & MIN_SAFE_INTEGER.

var nn = Number(45.45)

console.log(Number.parseInt(nn))

console.log(Number.MAX_VALUE)

console.log(Number.MIN_VALUE)

console.log(Number.MIN_SAFE_INTEGER)

console.log(Number.MAX_SAFE_INTEGER)