Skip to content

Instantly share code, notes, and snippets.

@Maciek416
Created May 8, 2013 15:34
Show Gist options
  • Save Maciek416/5541286 to your computer and use it in GitHub Desktop.
Save Maciek416/5541286 to your computer and use it in GitHub Desktop.
Prefixing list comprehensions with "then"
# This form doesn't work
a = num for num in [0..364]
alert(a.join(","))
# This form works
a = (num for num in [0..364])
alert(a.join(","))
# This form also works
a = then num for num in [0..364]
alert(a.join(","))
@corbanbrook
Copy link

a = for num in [0..364]
alert(a.join(","))

@kalupa
Copy link

kalupa commented May 8, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment