A class for representing a range of numbers and also iterating through them. When next.done is true, resets the internal counter back to start.

Implements

  • IterableIterator<number>

Constructors

Properties

_length: number
at: ((index: number) => undefined | number) = ...

Alias of nth.

Type declaration

    • (index): undefined | number
    • Returns the number at index in this range. index can be negative to access indices starting from the end.

      Parameters

      • index: number

      Returns undefined | number

has: ((n: number) => boolean) = ...

Alias of includes.

Type declaration

    • (n): boolean
    • Returns true if n is inside of this range.

      Parameters

      • n: number

      Returns boolean

i: number
start: number

The start of this range of numbers (inclusive).

step: number

Each iteration is increased by this amount.

stepSign: number

The sign of step.

stop: number

The stop/end point of this range of numbers (exclusive).

Accessors

Methods

  • Returns IterableIterator<number, any, any>

  • Returns IteratorResult<number, any>

  • Returns the number at index in this range. index can be negative to access indices starting from the end.

    Parameters

    • index: number

    Returns undefined | number