isLength source npm

_.isLength(value)

Checks if value is a valid array-like length.

Note: This function is loosely based on ToLength.

Arguments

  1. value (*)

    The value to check.

Returns (boolean)

Returns true if value is a valid length, else false.

Example

_.isLength(3);
// => true

_.isLength(Number.MIN_VALUE);
// => false

_.isLength(Infinity);
// => false

_.isLength('3');
// => false