Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save fernandovega/4b19197c384f35f52686c30a133965d7 to your computer and use it in GitHub Desktop.
Save fernandovega/4b19197c384f35f52686c30a133965d7 to your computer and use it in GitHub Desktop.
Merge Object with ES7 object spread
const obj1 = {name:"xiaoming", age: 23}
const obj2 = {age: 33}
const obj3 = {...obj1, ...obj2}
//obj3 ==> {"name":"xiaoming","age":33}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment