-
-
Save ABIDULLAH786/d0bee8e9f9e2b299fb3a3a75a6a61e9d 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
// Longhand | |
const user = { name: 'John', age: 30 }; | |
const updatedUser = Object.assign({}, user, { age: 31 }); | |
// Shorthand | |
const user = { name: 'John', age: 30 }; | |
const updatedUser = { ...user, age: 31 }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment