map_values
function:
Map an object values. The first argument should be the object and the second should be a function to map the values to.
Examples:
- running:
(map_values {"a": 1, "aa": 2, "aaa": 3, "aaaa": 4}, (% . 2))
will give:{"a": 1, "aa": 0, "aaa": 1, "aaaa": 0}
- running:
(map_values {"a": 1, "aa": 2, "aaa": 3, "aaaa": 4}, (+ . ^.))
for input:3
will give:{"a": 4, "aa": 5, "aaa": 6, "aaaa": 7}
Because it adds the input (3) to all the values.
- running:
(map_values [1, 2, 4], false)
will return nothing