Function range

  • Returns a RangeIterator for all numbers starting at the start index and one step before the stop index.

    Parameters

    • stop: number

      The stop index (exclusive).

    Returns RangeIterator

    This functionally behaves the same as Python 3's range builtin, with the exception of here: range(1, 0) == [1], whereas in Python, it returns an empty iterator: [].

  • Returns a RangeIterator for all numbers starting at the start index and one step before the stop index.

    Parameters

    • start: number

      The start index (inclusive) (default: 0).

    • stop: number

      The stop index (exclusive).

    Returns RangeIterator

    This functionally behaves the same as Python 3's range builtin, with the exception of here: range(1, 0) == [1], whereas in Python, it returns an empty iterator: [].

  • Returns a RangeIterator for all numbers starting at the start index and one step before the stop index.

    Parameters

    • start: number

      The start index (inclusive) (default: 0).

    • stop: number

      The stop index (exclusive).

    • step: number

      The optional amount to increment each step by, can be positive or negative (default: Math.sign(stop - start)).

    Returns RangeIterator

    This functionally behaves the same as Python 3's range builtin, with the exception of here: range(1, 0) == [1], whereas in Python, it returns an empty iterator: [].