Hacker News new | ask | show | jobs
by davenportw15 4064 days ago
Does 'each' serve as both forEach and map? It appears that way from the fib example.
1 comments

Yes. 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.