Apply a callback to an array

From Fōrmulæ wiki
Jump to: navigation, search

This page is the answer to the task Apply a callback to an array in the Rosetta Code.

Description (from Rosetta Code)


Take a combined set of elements and apply a function to each element.


The next expression squares the elements of an array. The resulting array is a new one, the original one is not changed.


The elements do not need to be strictly numbers: