.map(callback)

Description

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

Parameters

Map takes a callback function as a parameter.

Usage On Arrays

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

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

Last updated

Was this helpful?