Skip to content

Instantly share code, notes, and snippets.

@suhailgupta03
Created August 16, 2023 16:02
Show Gist options
  • Save suhailgupta03/92df89d7529c9d323ec3f59187416e63 to your computer and use it in GitHub Desktop.
Save suhailgupta03/92df89d7529c9d323ec3f59187416e63 to your computer and use it in GitHub Desktop.
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