Created
August 16, 2023 16:02
-
-
Save suhailgupta03/92df89d7529c9d323ec3f59187416e63 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
let student = { | |
name: 'Mike', | |
age: 23, | |
city: 'Paris' | |
} | |
let studentParentDetails = { | |
fatherName: 'John', | |
motherName: 'Jane' | |
} | |
// To merge two objects, we can use the spread operator | |
let studentDetails = { | |
...student, | |
...studentParentDetails | |
} | |
console.log(studentDetails) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment