Last active
October 22, 2019 05:08
-
-
Save MidasXIV/41d71bb89fb685c88e8354185774d2e3 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
var pokemon = { | |
id: 25, | |
name: 'Pikachu', | |
type: ['electric'], | |
ability: { | |
primary: 'Static', | |
hidden: 'Lightning Rod' | |
}, | |
moves: ['Quick Attack', 'Thunderbolt', 'Iron Tail', 'Volt Tackle'], | |
competative: [ | |
{ weakness: ['Ground'] }, | |
{ resistance: ['Flying', 'Steel', 'Electric'] } | |
] | |
}; | |
var returnMoves = function({moves}){ | |
return moves; | |
} | |
var returnAbilities = function({ability}){ | |
return ability; | |
} | |
console.log(returnMoves(pokemon)); | |
// ["Quick Attack", "Thunderbolt", "Iron Tail", "Volt Tackle"] | |
console.log(returnAbilities(pokemon)); | |
// { hidden: "Lightning Rod", primary: "Static" } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment