Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "iter/constant/docs/types/index.d"

Index

Interfaces

Type aliases

Functions

Type aliases

Iterator

Iterator: Iter | IterableIterator

Functions

Export assignment iterConstant

  • Returns an iterator which always returns the same value.

    Notes

    • If an environment supports Symbol.iterator, the returned iterator is iterable.
    throws

    iter option must be a nonnegative integer

    Parameters

    • value: any

      value to return

    • Optional options: Options

      function options

    Returns Iterator

    iterator

    Example

    var iter = iterConstant( 3.14 );
    
    var v = iter.next().value;
    // returns 3.14
    
    v = iter.next().value;
    // returns 3.14
    
    v = iter.next().value;
    // returns 3.14
    
    // ...