map
Examples
Simple addition
[1, 2, 3].map($this + 1)
// [2, 3, 4]Using $key for the index
$key for the index[10, 20, 30].map($key)
// [0, 1, 2][10, 20, 30].map($key + $this)
// [10, 21, 32]Extracting nested properties
[
{"x": "foo"},
{"x": "bar"},
{"x": "baz"}
].map(x)
// ["foo", "bar", "baz"]Fizzbuzz
Last updated