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.

Answer from zerkms on Stack Overflow
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Number
Number - JavaScript | MDN
A number literal like 37 in JavaScript code is a floating-point value, not an integer. There is no separate integer type in common everyday use. (JavaScript also has a BigInt type, but it's not designed to replace Number for everyday uses.
🌐
W3Schools
w3schools.com › js › js_number_methods.asp
W3Schools.com
Safe integers are all integers from -(253 - 1) to +(253 - 1). This is safe: 9007199254740991.
🌐
Mozilla
developer.mozilla.org › en-US › docs › Web › JavaScript › Guide › Data_structures
JavaScript data types and data structures - JavaScript | MDN
Although a number is conceptually a "mathematical value" and is always implicitly floating-point-encoded, JavaScript provides bitwise operators. When applying bitwise operators, the number is first converted to a 32-bit integer.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Number › isInteger
Number.isInteger() - JavaScript | MDN
If the target value is an integer, return true, otherwise return false. If the value is NaN or Infinity, return false. The method will also return true for floating point numbers that can be represented as integer.
🌐
SheCodes
shecodes.io › athena › 24057-what-is-an-integer-in-javascript
[JavaScript] - What is an Integer in JavaScript? - SheCodes | SheCodes
Learn about the definition and usage of integers in JavaScript and how they are stored as data types.
🌐
JavaScript.info
javascript.info › tutorial › the javascript language › data types
Numbers
They “read” a number from a string until they can’t. In case of an error, the gathered number is returned. The function parseInt returns an integer, whilst parseFloat will return a floating-point number:
🌐
TutorialsTeacher
tutorialsteacher.com › javascript › javascript-number
JavaScript Numers: Integer, Float, Binary, Exponential, Hexadecimal, Octal
Numbers can be positive or negative integers. However, integers are floating-point values in JavaScript. Integers value will be accurate up to 15 digits in JavaScript.
Find elsewhere
🌐
Reddit
reddit.com › r/javascript › [askjs] its about time javascript should get a "integer" and "float" data type.
r/javascript on Reddit: [AskJS] Its about time javascript should get a "integer" and "float" data type.
August 10, 2022 -

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?

🌐
Codecademy
codecademy.com › docs › javascript › number methods › .isinteger()
JavaScript | Number Methods | .isInteger() | Codecademy
October 13, 2021 - It accepts a single argument, value, and returns true if the passed argument is an integer, and returns false otherwise.
🌐
James Darpinian
james.darpinian.com › blog › integer-math-in-javascript
Integer math in JavaScript | James Darpinian
July 11, 2022 - You may know that all numbers in JavaScript are 64 bit double-precision floating point values. This is sometimes convenient and it works pretty well as a default for novice programmers, who are often confused by integer math, and rightfully ...
🌐
Stack Overflow
stackoverflow.com › questions › 68672641 › javascript-data-type-integer
Javascript data type integer - Stack Overflow
@Richard: There is not an integer data type in JavaScript. Just use integer numbers. If you have arithmetic operations that have fractional results use the Math.floor() function to convert the result to an integer value.
🌐
Exploring JS
exploringjs.com › js › book › ch_numbers.html
Numbers • Exploring JavaScript (ES2025 Edition)
However, all numbers are floating point numbers. Integer numbers are simply floating point numbers without a decimal fraction:
🌐
Educative
educative.io › answers › how-to-generate-an-integer-in-javascript
How to generate an integer in JavaScript
One such function is ParseInt(), which can be used to obtain an integer from a string.
🌐
Neo4j
neo4j.com › docs › api › javascript-driver › current › class › lib6 › integer.js~Integer.html
Integer | Neo4j Bolt Driver 6.x for JavaScript
import Integer from 'neo4j-driver-core/lib/integer.js' public class | source · Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as signed integers. See exported functions for more convenient ways of operating integers.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Number › parseInt
Number.parseInt() - JavaScript | MDN
An integer parsed from the given string. If the radix is smaller than 2 or bigger than 36, or the first non-whitespace character cannot be converted to a number, NaN is returned. This method has the same functionality as the global parseInt() function: js · Number.parseInt === parseInt; // true ·
🌐
2ality
2ality.com › 2014 › 02 › javascript-integers.html
What are integers in JavaScript?
Second, the ECMAScript specification has integer operators: namely, all of the bitwise operators. Those operators convert their operands to 32-bit integers and return 32-bit integers. For the specification, integer only means that the numbers don’t have a decimal fraction, and 32-bit means that they are within a certain range.
🌐
Programiz
programiz.com › javascript › numbers
JavaScript Number (with Examples)
// check if num1 is integer let num1 = 12; console.log(Number.isInteger(num1)); // true // check if num2 is NaN let num2 = NaN; console.log(Number.isNaN(num2)); // true // display up to two decimal points let num3 = 5.1234; console.log(num3.toFixed(2)); // 5.12
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › BigInt
BigInt - JavaScript | MDN
The best way to achieve nearly the same effect in JavaScript is through the BigInt() function: BigInt(x) uses the same algorithm to convert x, except that Numbers don't throw a TypeError, but are converted to BigInts if they are integers.