Skip to content

Instantly share code, notes, and snippets.

@nicolasmendonca
Created July 7, 2019 14:50
Show Gist options
  • Save nicolasmendonca/1b247c4c0835872a616dffc7f4b501aa to your computer and use it in GitHub Desktop.
Save nicolasmendonca/1b247c4c0835872a616dffc7f4b501aa to your computer and use it in GitHub Desktop.
function mapProductName(transactionsArray) {
return transactionsArray
.map(
({ productName, ...rest }) => ({
...rest,
product: { name: productName }
}),
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment