Does coffeescript offer an equivalent for "else" within array comprehensions like python's list comprehensions?
Python example
foo = ["yes" if i < 50 else "no" for i in range(100)]
Since, in python, the if/else is actually a ternary statement, I figured coffeescript might be similar, so I tried this:
coffeescript attempt
foo = (if i < 50 then "yes" else "no" for i in [0..100])
The difference is that python appropriately gives me 50 yes's and 50 no's, but coffeescript only gives me a single "yes".
So, just to be clear, I want to know if there is a way to use an "else" in coffeescript's array comprehensions.