Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ValueIterator<T>

An iterator for the values in an object.

Notes

This iterator can be used for any JS object.

Type parameters

  • T

Hierarchy

  • ValueIterator

Implements

Index

Constructors

Properties

Methods

Constructors

constructor

  • new ValueIterator(source: object, keys?: string[]): ValueIterator
  • Construct a new value iterator.

    Parameters

    • source: object

      The object of interest.

      • [key: string]: T
    • Default value keys: string[] = Object.keys(source)

      The keys to iterate, if known.

    Returns ValueIterator

Properties

Private _index

_index: number = 0

Private _keys

_keys: string[]

Private _source

_source: object

Type declaration

  • [key: string]: T

Methods

clone

iter

  • Get an iterator over the object's values.

    Returns IIterator<T>

    An iterator which yields the object's values.

next

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

    Returns T | undefined

    The next value from the iterator, or undefined.

Generated using TypeDoc