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

8 lines
182 B
CoffeeScript

bowl = ["Cheese", "Tomato"]
smash = (ingredient) ->
return "Smashed #{ingredient}"
contents = smash ingredient for ingredient in bowl
# => ["Smashed Cheese", "Smashed Tomato"]