3 ms·
Does 'each' serve as both forEach and map? It appears that way from the fib example.
by davenportw15 11y ago
Does 'each' serve as both forEach and map? It appears that way from the fib example.
- breuleux 11y agoYes. The compiler detects whether the return value is used or not to determine whether to accumulate the results in an array or not. Also, unlike forEach and map you can use continue or break.