Making Ruby Yours

Pulling at a Loose Thread

One day I noticed an inconsistency as I was joining together lists of words. Consider this no-delimiter join:

arr = [ ['some', 'lists'], ['of', 'different', 'words'] ] # => ['somelists', 'ofdifferentwords']

It’s point-free and clean, aside from the funny ampersand.

DZone Web Dev Zone

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.