Skip to content

@lang:filter

Keep elements of an array for which a helper returns truthy.

Returns: array

@lang:filter(arr fn)
NameTypeDescription
arrarraySource array
fnhelperPredicate helper returning bool
  • @find — return the first match
  • @all — check if all elements match
  • @any — check if any element matches
  • @map — transform each element