Function isArrayLikeObject

  • Checks if the given value is a non-primitive, array-like object.

    Parameters

    • value: unknown

      The value to check.

    Returns value is ArrayLike<unknown> & object

    true if the value is a non-primitive, array-like object, false otherwise.

    isArrayLikeObject([1, 2, 3]); // true
    isArrayLikeObject({ 0: 'a', length: 1 }); // true
    isArrayLikeObject('abc'); // false
    isArrayLikeObject(()=>{}); // false