-
-
Save ilearnjavascript/e85503d314e322702d1bf70ae83f34c8 to your computer and use it in GitHub Desktop.
es6 - new methods - 14.js
This file contains hidden or 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
var target = { a: 1, b: 2 }; | |
var source = { b: 4, c: 5 }; | |
var returnedTarget = Object.assign(target, source); | |
console.log(target); | |
// outputs: Object { a: 1, b: 4, c: 5 } | |
console.log(returnedTarget); | |
// outputs: Object { a: 1, b: 4, c: 5 } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment