Home Manual Reference Source

Function

Static Public Summary
public

count(start: number, step: number): IterableIterator<number>

Yields increasing or decreasing sequences of numbers.

Static Private Summary
private

* _count(start: number, step: number): IterableIterator<number>

Yields increasing or decreasing sequences of numbers.

Static Public

public count(start: number, step: number): IterableIterator<number> source

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.

Params:

NameTypeAttributeDescription
start number
  • optional
  • default: 0

The starting value.

step number
  • optional
  • default: 1

The step between the values.

Return:

IterableIterator<number>

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

Yields increasing or decreasing sequences of numbers. The starting value and the step between separating output values can be chosen.

Params:

NameTypeAttributeDescription
start number

The starting value.

step number

The step between the values.

Return:

IterableIterator<number>

Example:

// equivalent to list( range( 7 ) )
list( head( _count( 0 , 1 ) , 7 ) ) ;
// returns [0,-1,-2,-3,-4]
list( head( _count( 0 , -1 ) , 5 ) ) ;