Iterable

Class Itarray

Implements Iterable<T>

constructor (values: Array<Iterable<T>>): Itarray<T>

Name Type Default Description
values Array<Iterable<T>>    

readonly Property .values

Method .[Symbol.iterator] (): Generator<T, void, unknown>

Method .concat (newValues: Iterable<T>): void

Name Type Default Description
newValues Iterable<T>    

Method .every (fn: (t: T, i: number): boolean): boolean

Name Type Default Description
fn (t: T, i: number): boolean    

Method .filter (fn: (t: T, i: number): unknown): Itarray<T>

Name Type Default Description
fn (t: T, i: number): unknown    

Method .map (fn: (t: T, i: number): S): Itarray<S>

Name Type Default Description
fn (t: T, i: number): S    

Method .slice (from: number, to: number): Itarray<T>

Name Type Default Description
from number    
to number    

Method .some (fn: (t: T, i: number): boolean): boolean

Name Type Default Description
fn (t: T, i: number): boolean    

static Method .make (fn: (i: number): T, max: number): Itarray<T>

Name Type Default Description
fn (i: number): T    
max number    

every (set: Iterable<T>, callback: (v: T): unknown): boolean

Name Type Default Description
set Iterable<T>    
callback (v: T): unknown    

findMin (items: Iterable<T>, value: (item: T): number, max: number, min: number): undefined|T

Find the item in an iterable for which value() returns the smallest value.

Name Type Default Description
items Iterable<T>    
value (item: T): number    
max number  
min number    

first (set: Iterable<T>): undefined|T

Name Type Default Description
set Iterable<T>    

flatMap (set: Iterable<T>, map: (x: T): Iterable<S>): Generator<S, void, unknown>

Name Type Default Description
set Iterable<T>    
map (x: T): Iterable<S>    

listPairs (list: Array<T>): Iterable<[T, T]>

Name Type Default Description
list Array<T>    

pairs (a: Iterable<S>, b: Iterable<T>): Iterable<[S, T]>

Name Type Default Description
a Iterable<S>    
b Iterable<T>    

some (set: Iterable<T>, callback: (v: T): unknown): boolean

Name Type Default Description
set Iterable<T>    
callback (v: T): unknown    

Copyright © 2024 Mathigon.org