Standard built-ins
Iterator.prototype.map()
Lazily transforms each value using a callback receiving value and index.
Formal Syntax & Structure
javascript syntaxjavascript
iterator.map(mapper)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| mapper | function | Mapping callback. |
Return Value
Iterator
Result of the operation.
Working Example
Example Snippetjavascript
console.log(JSON.stringify(Iterator.from([1,2]).map(x=>x*3).toArray()));