Function arrayLike

  • Type Parameters

    • T

    Parameters

    Returns readonly T[]

    Description

    Creates a proxy object that allows for readonly array-like access to the elements of the input iterator. Some important things to note are:

    • length will always be the length of the internal cache, not the length of the final iterated values.
    • Symbol.iterator will always iterate over the entire input iterator, not just the cached values.
    • Negative indices are allowed, and will seek backwards from the end of the internal cache.