Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

ArgumentTypeDescription
$var

$-variable

A $-variable which will be set to each item in set in turn before script is processed.
setArray or RecordsetThe set of items which will be iterated over.
script$-variableA comma-separated list of expressions which will be processed once for each entry in set.

forEach() is like every other function in that it returns a value.: 

  • Its return value is a list containing the last statement executed in each iteration.
  • All the $-variables used in the call to forEach() keep their values between iterations.
  • All the $-variables used in the call to forEach() will be available after it has returned.

...

Use in Conjunction With

  • continue, will continue to the next item in the set.
  • break, will break out of the forEach loop. 

Examples


In the first two examples, let

...