Map Reduce in Coffeescript
One of my favorite things about coffeescript is it’s loops and comprehensions. Check out this little gem.
dogs = [‘poodle’,’ugly poodle’, ‘ugly basset hound’, ‘puggle’, ‘newfoundland’]
uglyDogs = (dog for dog in dogs when dog.match /ugly/)
I won’t even show you what that looks like in compiled JS because you may just temporarily lose vision in your eyes.