Skip to content

Instantly share code, notes, and snippets.

@juliobetta
Last active December 9, 2020 01:57
Show Gist options
  • Save juliobetta/dae5a4c98cdf880077992e7df8e9dd85 to your computer and use it in GitHub Desktop.
Save juliobetta/dae5a4c98cdf880077992e7df8e9dd85 to your computer and use it in GitHub Desktop.
const mapped = characters.map(character => character.name);
const reduced = characters.reduce((accumulator, character) => [...accumulator, character.name], []);
// [
// "Donkey Kong",
// "Captain Falcon",
// "Fox",
// "Kirby",
// "Link"
// ];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment