1.0.0 • Published 9 years ago
@f/map-values v1.0.0
map-values
Map the values of an object to an array.
Note: This is the opposite meaning of mapValues that lodash uses
Installation
$ npm install @f/map-valuesUsage
var mapValues = require('@f/map-values')
mapValues({a: 1, b: 2, c: 3}, add1) // -> [2, 3, 4]
function add1 (n) {
return n + 1
}API
mapValues(fn, obj)
fn-fn(val, key) -> newVal. Receivesvalandkey, 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.
License
MIT
1.0.0
9 years ago