Created
March 1, 2019 07:21
-
-
Save joelnet/7e50ff766c33863c243b87b2ab92a982 to your computer and use it in GitHub Desktop.
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
const user = { id: 100, name: 'Howard Moon'} | |
const userWithPass = { ...user, password: 'Password!' } | |
user //=> { id: 100, name: 'Howard Moon' } | |
userWithPass //=> { id: 100, name: 'Howard Moon', password: 'Password!' } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This gist is written for 7 Tricks with Resting and Spreading JavaScript Objects