Signature: map(iterator: iterator, fn: function) -> iterator

Description: Transforms each element in an iterator using a function, returning a new iterator.

Parameters

Returns: Iterator

Example

let doubled = map(range(1, 4), fn(x) { x * 2 })
forEach(doubled, print)  // Prints: 2, 4, 6