Home Manual Reference Source

Function

Static Public Summary
public

* nrepeat(item: any, times: Number): IterableIterator

Repeats the input item a few times.

public

* repeat(item: Object): Iterator

Repeats the input item endlessly.

Static Public

public * nrepeat(item: any, times: Number): IterableIterator source

Repeats the input item a few times. Returns an iterator that yields the input item a fixed number of times.

Params:

NameTypeAttributeDescription
item any

The input item.

times Number

The number of times to yield item.

Return:

IterableIterator

Example:

list( nrepeat( 6 , 3 ) ) ; // returns [ 6 , 6 , 6 ]

public * repeat(item: Object): Iterator source

Repeats the input item endlessly. Returns an iterator that yields the input item over and over again.

Params:

NameTypeAttributeDescription
item Object

The input item.

Return:

Iterator

Example:

list( take( repeat( 6 ) , 3 ) ) ; // returns [ 6 , 6 , 6 ]