Options
All
  • Public
  • Public/Protected
  • All
Menu

Class RangeIterator

An iterator which produces a range of evenly spaced values.

Hierarchy

  • RangeIterator

Implements

Index

Constructors

Properties

Methods

Constructors

constructor

  • new RangeIterator(start: number, stop: number, step: number): RangeIterator
  • Construct a new range iterator.

    Parameters

    • start: number

      The starting value for the range, inclusive.

    • stop: number

      The stopping value for the range, exclusive.

    • step: number

      The distance between each value.

    Returns RangeIterator

Properties

Private _index

_index: number = 0

Private _length

_length: number

Private _start

_start: number

Private _step

_step: number

Private _stop

_stop: number

Methods

clone

  • Create an independent clone of the iterator.

    Returns IIterator<number>

    A new independent clone of the iterator.

iter

  • Get an iterator over the object's values.

    Returns IIterator<number>

    An iterator which yields the object's values.

next

  • next(): number | undefined
  • Get the next value from the iterator.

    Returns number | undefined

    The next value from the iterator, or undefined.

Generated using TypeDoc