JavaScript numbers are stored as 64-bit, floating-point numbers. So integers in JavaScript are floating-point numbers without a decimal fraction or a decimal fraction with all 0's.
In ES5, there was no built-in way to check whether a number is an integer or not. There exists a new method to the Number object called isInteger(), which takes a number and returns true or false, depending on whether the number is an integer or not. Here is an example:
let a = 17.0;let b = 1.2;console.log(Number.isInteger(a));console.log(Number.isInteger(b));
The output is as follows:
truefalse