Created
September 23, 2019 15:57
-
-
Save NyaGarcia/db89365577f15673d8dd20370547ca52 to your computer and use it in GitHub Desktop.
Destructuring with the rest parameter
This file contains 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
const pokemon = { | |
id: 1, | |
name: 'Squirtle', | |
type: 'Water' | |
}; | |
const { id, ...rest } = pokemon; | |
console.log(rest); //Result: { name: 'Squirtle', type: 'Water' } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment