Created
April 23, 2019 16:44
-
-
Save syeo66/c2c2f4f3041bca606fc34275e13073b7 to your computer and use it in GitHub Desktop.
Using .map() to mutate object properties new
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const result = objects.map(obj => ({ | |
...obj, | |
slug: `${obj.firstname}-${obj.name}`.toLowerCase() | |
})); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment