• Fast and 'costless' range function for javascript based on generators.

    Parameters

    • start: number
    • Optional end: number
    • Optional step: number

    Returns Generator<number, void, unknown>

    Example

    import { range } from 'deleight/generators';
    const arr1000 = [...range(0, 1000)];
    // creates an array with 1000 items counting from 0 to 999.