All About Procs: Adding Suffixes

Published by Helen Yu in

Write a function that returns a proc, which transforms its input by adding a particular suffix at the end.

Examples

add_ly = add_suffix("ly")

add_ly.call("hopeless") ➞ "hopelessly"
add_ly.call("total") ➞ "totally")

add_less = add_suffix("less")

add_less.call("fear") ➞ "fearless")
add_less.call("ruth") ➞ "ruthless")

Notes

N/A

Watch a quick demo on how Edabit works.