Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
davenportw15
· 11y ago · 0 comments
Does 'each' serve as both forEach and map? It appears that way from the fib example.
Comments
[–]
breuleux
11y ago
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.