Skip to content

Instantly share code, notes, and snippets.

@MidasXIV
Created October 22, 2019 05:30
Show Gist options
  • Save MidasXIV/0e62df979f559d4606f1b9b4840f6b1f to your computer and use it in GitHub Desktop.
Save MidasXIV/0e62df979f559d4606f1b9b4840f6b1f to your computer and use it in GitHub Desktop.
let pokemon = {
"name": "Pikachu",
"id": 25,
"type": "electric",
"ability": {
"primary": "Static",
"hidden": "Lightning rod"
},
"moves": ["Quick Attack", "Volt Tackle", "Iron Tail", "Thunderbolt"]
};
const getAbilities = ({ ability }) => {
return ability;
}
let { primary: primaryAbility } = getAbilities(pokemon);
let { hidden: hiddenAbility } = getAbilities(pokemon);
console.log(primaryAbility);
console.log(hiddenAbility);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment