Function fill

Yields v for each item within it.

fill([1, 2, 3], 0);
// Yields: [0, 0, 0]

This is like a map where we return a fixed value, ignoring the input.

  • Type Parameters

    • V

    Parameters

    • it: AsyncIterable<V>
    • v: V

    Returns AsyncGenerator<V>

  • Type Parameters

    • V

    Parameters

    • it: Iterable<V>
    • v: V

    Returns Generator<V>