Skip to content

Instantly share code, notes, and snippets.

@MidasXIV
Created October 22, 2019 05:18
Show Gist options
  • Save MidasXIV/d7f7038034d674a353fd3941cc81129b to your computer and use it in GitHub Desktop.
Save MidasXIV/d7f7038034d674a353fd3941cc81129b 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"]
};
let {
type,
name: MXIV,
moves,
ability: {
primary: primaryAbility,
hidden: hiddenAbility
},
moves: [firstMove, , lastMove]
} = pokemon;
console.log(`Name:: ${MXIV} `);
console.log(`Type:: ${type} `);
console.log(`moves:: ${moves} `);
console.log(`ability:: ${primaryAbility} `);
console.log(`ability:: ${hiddenAbility} `);
console.log(`1st Move:: ${firstMove} `);
console.log(`last Move:: ${lastMove} `);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment