Skip to content

@lang:reduce

Reduce an array to a single value by applying a helper.

Returns: any

@lang:reduce(arr fn initial)
NameTypeDescription
arrarraySource array
fnhelperReducer helper receiving (accumulator, element)
initialanyInitial accumulator value
  • @map — transform each element
  • @filter — keep elements by predicate