DEV Community

Discussion on: Ruby: Getting Collect, Map, and Select Set Straight

Collapse
 
morinoko profile image
Felice Forby

Ah, good catch on splitting the word too many times. It would definitely be better to split the word in the initialize method so it's only done once. Also, yes, the block does not need to return "real" values - your suggestion would simplify the code. I'll fix this up based on your feedback. Thank you!