Skip to content

Instantly share code, notes, and snippets.

@DawTaylor
Created January 8, 2018 13:17
Show Gist options
  • Save DawTaylor/0da53ae88a4344eb8b3d7d65bd8c8238 to your computer and use it in GitHub Desktop.
Save DawTaylor/0da53ae88a4344eb8b3d7d65bd8c8238 to your computer and use it in GitHub Desktop.
Spead operator uses
// This is our User
const User = {
name: 'John Doe',
email: '[email protected]',
status: 'enabled'
}
// NewUser is now a clone of User
const NewUser = {
...User
}
// We may update our user at time
const NewUpdatedUser = {
...User,
status: 'disabled'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment