Wilang Documentation1.0.0+4

forEach#

Iterates over all elements of a matrix/array, and executes the given callback function.

Available in: math cells, REPL.

Syntax#

forEach(x, callback)

Arguments and behavior#

Calls a callback for each entry. It does not collect transformed values; use map when you need a new array.

Example#

Edit the inputs, then use Run or Reset. Changes stay in this example.

Example
forEach([1,2,3],abs)

Expected result: empty.

See also#

map · sort · filter

All functions · Math guides