@nevware21/ts-utils
    Preparing search index...

    Function arrKeys

    • Returns an iterator over all numeric keys from 0 to length - 1.

      This uses Array.prototype.keys() when available and falls back to polyArrKeys. Unlike arrIndexKeys, this always iterates all index positions, including holes.

      Type Parameters

      • T = any

      Parameters

      • value: ArrayLike<T>

        The array-like value to get key iterator for.

      Returns IterableIterator<number>

      An iterable iterator of numeric index keys.

      0.14.0

      arrFrom(arrKeys(["a", "b", "c"]));
      // [0, 1, 2]

      const sparse: any[] = [];
      sparse[2] = "c";
      arrFrom(arrKeys(sparse));
      // [0, 1, 2]