verify if number is not floating 1

verify if number is not floating

let number = 2.4
Number.isInteger(number) // false

let number2 = 2
Number.isInteger(number2) // true

Here is what the above code is Doing:
1. We create a variable called number and assign it the value 2.4.
2. We call the Number.isInteger() method, passing in the number variable as an argument.
3. The Number.isInteger() method returns false because the number variable is not an integer.
4. We create a variable called number2 and assign it the value 2.
5. We call the Number.isInteger() method, passing in the number2 variable as an argument.
6. The Number.isInteger() method returns true because the number2 variable is an integer.

Similar Posts