_.isLength(value)

sourcenpm package

Checks if value is a valid array-like length.Note: This method is loosely based on ToLength.

Since

4.0.0

Arguments

  • value (*): The value to check.

Returns

(boolean): Returns true if value is a valid length, else false.

Example

  1. _.isLength(3);
    // => true
    _.isLength(Number.MIN_VALUE);
    // => false
    _.isLength(Infinity);
    // => false
    _.isLength('3');
    // => false