You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

is-array-like.js 239B

123456789
  1. const getLength = require('./get-length');
  2. const MAX_ARRAY_INDEX = 2 ** 53 - 1;
  3. module.exports = (collection) => {
  4. const length = getLength(collection);
  5. return typeof length == 'number' && length >= 0 && length <= MAX_ARRAY_INDEX;
  6. };