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)Interactive examples could not load. You can still copy the expressions.
Expected result: empty.