Function
Static Public Summary | ||
public |
Yields increasing or decreasing sequences of numbers. |
Static Private Summary | ||
private |
Yields increasing or decreasing sequences of numbers. |
Static Public
public count(start: number, step: number): IterableIterator<number> source
import count from '@iterable-iterator/count/src/count.js'
Yields increasing or decreasing sequences of numbers. The starting value
and the step between separating output values can be chosen. Both parameters are
optional. The default for the starting value is 0
. The default
for the step between separating output values is 1
.
Example:
// equivalent to list( range( 7 ) )
list( head( count( ) , 7 ) ) ;
// returns [0,-1,-2,-3,-4]
list( head( count( 0 , -1 ) , 5 ) ) ;
Static Private
private * _count(start: number, step: number): IterableIterator<number> source
import _count from '@iterable-iterator/count/src/_count.js'
Yields increasing or decreasing sequences of numbers. The starting value and the step between separating output values can be chosen.
Example:
// equivalent to list( range( 7 ) )
list( head( _count( 0 , 1 ) , 7 ) ) ;
// returns [0,-1,-2,-3,-4]
list( head( _count( 0 , -1 ) , 5 ) ) ;