Skip to content

Instantly share code, notes, and snippets.

@syeo66
Created April 23, 2019 16:44
Show Gist options
  • Save syeo66/c2c2f4f3041bca606fc34275e13073b7 to your computer and use it in GitHub Desktop.
Save syeo66/c2c2f4f3041bca606fc34275e13073b7 to your computer and use it in GitHub Desktop.
Using .map() to mutate object properties new
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