.filter(callback)

Description

Filter is a method that returns an array of values from an array

Parameters

Filter takes a callback function as a parameter.

Usage On Arrays

arr = ["wow","hello","world"]
// setup the array

log arr.filter(def(val) -> (
  return val.toUpper().contains("O")
))
// returns ["WOW","WORLD"]
// the callback function was applied to each value

Last updated

Was this helpful?