3 ms·
I don't understand the point of it when the `.map(&:upcase)` syntax is shorter. This just seems like yet another syntactic sugar Rubyism that doesn't really add
by JasserInicide 2y ago
I don't understand the point of it when the `.map(&:upcase)` syntax is shorter. This just seems like yet another syntactic sugar Rubyism that doesn't really add anything.
If it's an alternative to the `|x|` syntax when using only one block variable, then I like that.
- graypegg 2y agoThat only works when calling a method on the things you’re iterating thru, it is a replacement for the single variable block example you gave there
- Trasmatta 2y ago`arr.map { it.thing.blah.stuff }` The `&:` doesn't work in that context
- ilvez 2y agoNot to point any fingers, but shows that the previous commenter have not struggled with this :) &: is very nice, but not enough.