Higher-order functions
func first(f) {
return f()
}
func second {
return "second"
}
say first(second) # => "second"
say first(func { "third" }) # => "third"
Last updated
Was this helpful?
func first(f) {
return f()
}
func second {
return "second"
}
say first(second) # => "second"
say first(func { "third" }) # => "third"
Last updated
Was this helpful?