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

8 lines
182 B
CoffeeScript
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
bowl = ["Cheese", "Tomato"]
smash = (ingredient) ->
return "Smashed #{ingredient}"
contents = smash ingredient for ingredient in bowl
# => ["Smashed Cheese", "Smashed Tomato"]