groovy-lecture/assignments/solutions/multiplier.groovy

6 lines
111 B
Groovy

def makeMultiplier(n) {
return {it * n}
}
def multiplierOf3 = makeMultiplier(3)
println(multiplierOf3(5))