ricardo_·15 yıl önce·discussIMO expressiveness has to do with being close to natural language: "multiply number by 2 for every number in 1 to 10". "map" is CS vocabulary.The conditional could be placed outside the string and still be a one-liner. It's there mostly for "flow".
ricardo_·15 yıl önce·discusslooks like I'm late to the party.. I rewrote most of them in CoffeeScript: http://ricardo.cc/2011/06/02/10-CoffeeScript-One-Liners-to-I...I'm specially fond of "Happy Birthday #{if i is 3 then "dear Robert" else "to You"}" for i in [1..4]
The conditional could be placed outside the string and still be a one-liner. It's there mostly for "flow".