Skip to content

Instantly share code, notes, and snippets.

@suhailgupta03
Created August 16, 2023 16:22
Show Gist options
  • Save suhailgupta03/c7ed3f9b8e0beea51f43e2f19f745515 to your computer and use it in GitHub Desktop.
Save suhailgupta03/c7ed3f9b8e0beea51f43e2f19f745515 to your computer and use it in GitHub Desktop.
let employee = {
name: 'John',
age: 30,
salary: 1000
}
let {salary, name} = employee;
// this is an example of destructuring
// assignment. We call this as destructuring
// because we are destructuring the object
// employee into two variables salary
// and name
console.log(salary); // 1000
console.log(name); // John
@suhailgupta03
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment