Converts value to an integer.
value
Note: This method is loosely based on ToInteger.
ToInteger
The value to convert.
Returns the converted integer.
5.5.0
[[isInteger]], [[isNumber]], [[toNumber]]
toInteger(3.2)// => 3toInteger(Number.MIN_VALUE)// => 0toInteger(Infinity)// => 1.7976931348623157e+308toInteger('3.2')// => 3 Copy
toInteger(3.2)// => 3toInteger(Number.MIN_VALUE)// => 0toInteger(Infinity)// => 1.7976931348623157e+308toInteger('3.2')// => 3
Converts
value
to an integer.Note: This method is loosely based on
ToInteger
.