UNPKG

@newdash/newdash

Version:

javascript/typescript utility library

28 lines (27 loc) 682 B
/** * Checks if `value` is array-like. A value is considered array-like if it's * not a function and has a `value.length` that's an integer greater than or * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. * * @since 5.3.0 * @category Lang * @param value The value to check. * @returns Returns `true` if `value` is array-like, else `false`. * @example * * ```js * isArrayLike([1, 2, 3]) * // => true * * isArrayLike(document.body.children) * // => true * * isArrayLike('abc') * // => true * * isArrayLike(Function) * // => false * ``` */ export declare function isArrayLike(value: any): value is ArrayLike<any>; export default isArrayLike;