Higher-order functions

func first(f) {
  return f()
}
 
func second {
  return "second"
}
 
say first(second)               # => "second"
say first(func { "third" })     # => "third"

Last updated