Created
October 15, 2016 09:47
-
-
Save scastiel/cd18abb17acce58f00768969af1170c4 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 objA = { | |
a: 1, | |
b: 2 | |
} | |
const objB = { | |
... objA | |
b: 3, | |
c: 4 | |
} | |
// Is equivalent to: | |
const objB = Object.assign({}, objA, { b: 3, c: 4 }); | |
console.log(objA, objB); | |
// { a: 1, b: 2 } { a: 1, b: 3, c: 4 } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment