Update snippet descriptions

This commit is contained in:
Isabelle Viktoria Maciohsek
2020-10-21 21:54:53 +03:00
parent 47276ac092
commit ce48fffb4d
41 changed files with 171 additions and 110 deletions

View File

@ -3,9 +3,9 @@ title: mapValues
tags: object,intermediate
---
Creates an object with the same keys as the provided object and values generated by running the provided function for each value.
Maps the values of an object using the provided function, generating a new object with the same keys.
- Use `Object.keys(obj)` to iterate over the object's keys.
- Use `Object.keys()` to iterate over the object's keys.
- Use `Array.prototype.reduce()` to create a new object with the same keys and mapped values using `fn`.
```js