Skip to content

Instantly share code, notes, and snippets.

@midorikocak
Last active September 25, 2021 12:46
Show Gist options
  • Save midorikocak/2725ca983523fc51a2d9bfe9dd033878 to your computer and use it in GitHub Desktop.
Save midorikocak/2725ca983523fc51a2d9bfe9dd033878 to your computer and use it in GitHub Desktop.
Object Composition
let person = {
name: 'midori',
hobbies: ['climbing', 'anime', 'playing piano', 'learning japanese']
}
let teacher = {
topic: 'coding',
years: 10
}
let teacherPerson = {...person, ...teacher};
console.log(teacherPerson);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment