Map the values of an object to an array.
Note: This is the opposite meaning of mapValues that lodash uses
$ npm install @f/map-values
var mapValues = require('@f/map-values')
mapValues(add1, {a: 1, b: 2, c: 3}) // -> [2, 3, 4]
function add1 (n) {
return n + 1
}
fn
-fn(val, key) -> newVal
. Receivesval
andkey
, and returns a new value to be put in the resulting array.obj
- The object who's values to map
Returns: An array containing the result of calling fn
on each value and key within obj
.
MIT