Created
January 8, 2018 13:17
-
-
Save DawTaylor/0da53ae88a4344eb8b3d7d65bd8c8238 to your computer and use it in GitHub Desktop.
Spead operator uses
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
// 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