kcl-stdfunctionsmap

mapFunction in std::array

Apply a function to every element of a list.

Given a list like [a, b, c], and a function like f, returns [f(a), f(b), f(c)]

Arguments

NameTypeDescriptionRequired
array[any]Input array. The output array is this input array, but every element has had the function f run on it.Yes
ffn(any): anyA function. The output array is just the input array, but f has been run on every item.Yes

Returns

[any]

Examples

Found a typo?