Skip to content

Instantly share code, notes, and snippets.

@MidasXIV
Last active October 22, 2019 05:08
Show Gist options
  • Save MidasXIV/41d71bb89fb685c88e8354185774d2e3 to your computer and use it in GitHub Desktop.
Save MidasXIV/41d71bb89fb685c88e8354185774d2e3 to your computer and use it in GitHub Desktop.
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