Converts value to an integer suitable for use as the length of an array-like object.
value
Note: This method is based on ToLength.
ToLength
The value to convert.
Returns the converted integer.
_.toLength(3);// => 3_.toLength(Number.MIN_VALUE);// => 0_.toLength(Infinity);// => 4294967295_.toLength('3');// => 3 Copy
_.toLength(3);// => 3_.toLength(Number.MIN_VALUE);// => 0_.toLength(Infinity);// => 4294967295_.toLength('3');// => 3
Converts
value
to an integer suitable for use as the length of an array-like object.Note: This method is based on
ToLength
.