Converts value to an integer.
value
This function first converts value to a finite number. If the result has any decimal places, they are removed by rounding down to the nearest whole number.
Optional
The value to convert.
Returns the number.
toInteger(3.2); // => 3toInteger(Number.MIN_VALUE); // => 0toInteger(Infinity); // => 1.7976931348623157e+308toInteger('3.2'); // => 3toInteger(Symbol.iterator); // => 0toInteger(NaN); // => 0 Copy
toInteger(3.2); // => 3toInteger(Number.MIN_VALUE); // => 0toInteger(Infinity); // => 1.7976931348623157e+308toInteger('3.2'); // => 3toInteger(Symbol.iterator); // => 0toInteger(NaN); // => 0
Alias