@stdlib/math
Version:
Standard math.
42 lines (31 loc) • 927 B
Plain Text
{{alias}}( [options] )
Returns an iterator which generates a sequence of prime numbers.
If an environment supports Symbol.iterator, the returned iterator is
iterable.
Parameters
----------
options: Object (optional)
Function options.
options.iter: integer (optional)
Number of iterations. Default: 245181918813464.
Returns
-------
iterator: Object
Iterator.
iterator.next(): Function
Returns an iterator protocol-compliant object containing the next
iterated value (if one exists) and a boolean flag indicating whether the
iterator is finished.
iterator.return( [value] ): Function
Finishes an iterator and returns a provided value.
Examples
--------
> var it = {{alias}}();
> var v = it.next().value
2
> v = it.next().value
3
> v = it.next().value
5
See Also
--------