RosettaCodeData/Task/Higher-order-functions/CoffeeScript/higher-order-functions-3.coffee

8 lines
182 B
CoffeeScript
Raw Permalink Normal View History

2013-04-10 21:29:02 -07:00
bowl = ["Cheese", "Tomato"]
smash = (ingredient) ->
return "Smashed #{ingredient}"
contents = smash ingredient for ingredient in bowl
# => ["Smashed Cheese", "Smashed Tomato"]