Skip to content

Instantly share code, notes, and snippets.

@njbmartin
Last active April 4, 2021 03:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save njbmartin/2cd62fa43b4df3a2a83b1c7b66bf617b to your computer and use it in GitHub Desktop.
Save njbmartin/2cd62fa43b4df3a2a83b1c7b66bf617b to your computer and use it in GitHub Desktop.
const person = {
firstName: "Jane",
lastName: "Bloggs",
email: "jane@example.com",
phone: "0123456789"
};
const {
email,
...personWithoutEmail
} = person
console.log(personWithoutEmail.email);
// expected output: undefined
console.log(person.email);
// expected output: "jane@example.com"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment