• Attaches a 'fake' length to an object (likely iterable or iterator) which does not have a length property, so that it can work well with functions that use getLength.

    Parameters

    • it: any
    • length: number

    Returns any

    Example

    import { getLength, setLength } from 'deleight/generational';
    const myRange = range(12);
    setLength(myRange, 12);
    getLength(myRange); // returns 12.