map
constmap: <T,U>(fn: (x:T) =>U,iterable:Iterable<T>) =>Iterable<U> =builtins.map
Defined in: packages/pythonlib/src/index.ts:155
Apply a function to every item of the iterable and yield the results.
Uses ES2024 Iterator.prototype.map() for lazy evaluation.
Type Parameters
| Type Parameter |
|---|
T |
U |
Parameters
| Parameter | Type | Description |
|---|---|---|
fn | (x: T) => U | The function to apply to each element |
iterable | Iterable<T> | The input iterable |
Returns
Iterable<U>
An iterable of transformed values