Created
January 18, 2019 16:05
-
-
Save CristalT/e9c14adc744710c092a6277006e3ef58 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
// replicate an object excepting some items | |
const hero = { | |
name: 'Bruno', | |
alterego: 'Batman', | |
superpowers: false, | |
couching: 8 | |
} | |
// Way one | |
const { couching, name, ...collection } = hero | |
console.log(collection) | |
// Way two | |
delete hero.couching | |
delete hero.name | |
console.log(hero) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment