4 ms·
You can also use Enumerable#map and Enumerable#reduce, to use names that match the pattern (and #map is arguably more idiomatic than #collect).
by cdcarter 15y ago
You can also use Enumerable#map and Enumerable#reduce, to use names that match the pattern (and #map is arguably more idiomatic than #collect).
- chrismealy 15y agoI finally got inject() when they added the reduce() alias.
- cdcarter 15y agoThe thing that confused me most about #inject was the term 'memo'...