UPDATE: with a new ES2020 standard released this answer is not entirely correct anymore, see the other answer (from @Mathias Lykkegaard Lorenzen) about BigInt details.
There is only the Number data type in JS that represents numbers.
Internally it is implemented as IEEE 754 double precision floating point number.
What it means is that - technically there is no dedicated data type that represents integer numbers.
Practically it means that we can safely use only numbers that are safely representable by the aforementioned standard. And it includes integer values in the range: [-9007199254740991; 9007199254740991]. Both values are defined as constants: Number.MIN_SAFE_INTEGER and Number.MAX_SAFE_INTEGER correspondingly.
[AskJS] Its about time javascript should get a "integer" and "float" data type.
Is there or isn't there an integer type in JavaScript? - Stack Overflow
Javascript data type integer - Stack Overflow
Maximum Integer in Js
Videos
After all the improvements/features and fixes which were made to javascript (or precisely ECMAScript) since ES6 (ES2015) till now (ES2022), isn't it about time to fix the ultimate pending weakness i.e. having an Integer and a Float type as well (just like "var" keyword was/is there but they added "let" and "const" as a better semantics and good practice) and not just mashup everything in Number.
Heck, we even got a big int to represent big integers (no floats allowed) but we still don't have Integer's and Floats which are SUPER useful in almost every scenario.
So, why is it still not added and not planned as well? Those are VERY important data types and MOST languages HAVE those data types as they are NEEDED, why is it not planned for ECMAScript? Is it planned? Do you want to see this added?
UPDATE: with a new ES2020 standard released this answer is not entirely correct anymore, see the other answer (from @Mathias Lykkegaard Lorenzen) about BigInt details.
There is only the Number data type in JS that represents numbers.
Internally it is implemented as IEEE 754 double precision floating point number.
What it means is that - technically there is no dedicated data type that represents integer numbers.
Practically it means that we can safely use only numbers that are safely representable by the aforementioned standard. And it includes integer values in the range: [-9007199254740991; 9007199254740991]. Both values are defined as constants: Number.MIN_SAFE_INTEGER and Number.MAX_SAFE_INTEGER correspondingly.
I should mention that there is actually a type called BigInt which represents a true integer.
However, because it can't be used with Number and is generally only a good idea to use for larger numbers, I wouldn't advise it.
I thought it was worth a mention though.
var n = BigInt(1337);
console.log(typeof n); //prints "bigint"
In JS max int value is 1e+309 but why?
and what is Infinity