Created
October 22, 2019 05:30
-
-
Save MidasXIV/0e62df979f559d4606f1b9b4840f6b1f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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