Skip to content

Instantly share code, notes, and snippets.

@pketh
Created January 31, 2015 17:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pketh/bfdd57d340d91c09c269 to your computer and use it in GitHub Desktop.
Save pketh/bfdd57d340d91c09c269 to your computer and use it in GitHub Desktop.
You don't need each, collect or select in Coffeescript
# from http://makandracards.com/makandra/18605-you-don-t-need-each-collect-or-select-in-coffeescript
## each
for item in items
...
## collect / map
ages = (person.age for person in people)
## select / grep
adults = (person for person in people when person.age >= 18)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment