Skip to content

Instantly share code, notes, and snippets.

@paulkoegel
Created September 5, 2016 14:07
Show Gist options
  • Save paulkoegel/ef31d2f1239b46d287e040b9e31ab175 to your computer and use it in GitHub Desktop.
Save paulkoegel/ef31d2f1239b46d287e040b9e31ab175 to your computer and use it in GitHub Desktop.
object-spread.js
const young_jim = {age: 20, name: "Jim", last_name: "Beam", guns: "many"};
const married_jim = { age: 34, name: "Jim", last_name: "Parker", hair: false };
const joined_jim = {...young_jim, ...married_jim};
console.log(joined_jim); // => { "age": 34, "guns": "many", "hair": false, "last_name": "Parker", "name": "Jim" }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment