Skip to content

Latest commit

 

History

History
33 lines (21 loc) · 585 Bytes

mapValues.md

File metadata and controls

33 lines (21 loc) · 585 Bytes

objects.mapValues

mapValues(object, func)

MapKeys iterates over an object and applies a function to each value

Arguments

  1. object (Object): input object
  2. func (Function): map function

Returns

(Object): object with mutated values

Example

const result = objects.mapValues({ a: 1, b: 2, c: 3 }, value => `neat_${value}`);
console.log(result);
> { a: neat_1, b: neat_2, c: neat_3 }