The function returns a new dict with equal keys but values computed as a result of a given closure callback.
This function does not generate a change.
dict.vmap(callback)
| Argument | Type | Description |
|---|---|---|
| callback | closure (required) | Closure to execute on each value. |
Explanation of the callback argument:
| Iterable | Arguments | Description |
|---|---|---|
| dict | value | Iterate over the dict values. |
Returns a new dict with equal keys but values as a result of a given closure.
This code shows how to use
vmap(..):
d = dict([
["a", 1],
["b", 2],
["c", 3],
]);
d.vmap(|x| x*x);
Return value in JSON format (Warning: the order is NOT guaranteed)
[
["a", 1],
["b", 4],
["c", 9]
]