Created
February 17, 2021 19:11
-
-
Save jonathan-fielding/6fb37c00e8fa2f3bf50dea842ba64de2 to your computer and use it in GitHub Desktop.
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
const obj1 = { | |
name: 'Jonathan', | |
age: 21 | |
} | |
const obj2 = { | |
name: 'Jonathan', | |
gender: 'male' | |
} | |
const person = Object.assign({}, obj1, obj2); | |
console.log(person); | |
// Result { name: 'Jonathan', age: 21, gender: 'male' } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment