each

Calls a given function (a closure) on each of the elements in the given array.

Usage: each values function

where:

  • values : can be an array or a closure which evaluates to an array.

  • function: a closure which must be invoked on each element.

    admin@localhost:/> each [Jan Feb Mar] { echo $it}
    Jan
    Feb
    Mar