Skip to content

Instantly share code, notes, and snippets.

@sleepyfox
Created February 21, 2012 23:37
Show Gist options
  • Save sleepyfox/1879845 to your computer and use it in GitHub Desktop.
Save sleepyfox/1879845 to your computer and use it in GitHub Desktop.
Nested array comprehension in CoffeeScript
cards = ["2", "3", "4"] # etc...
suits = ["hearts", "spades"] # etc...
array = (a+b for a in cards for b in suits)
alert array
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment