main.js
1
2
3
4
5
6
7
8
9
10
const cat = {  
  sound: 'meow',
  legs: 4
};

const anotherDog = {  
  ...cat,
  sound: 'woof' // <---- Overwrites cat.sound
};
console.log(anotherDog); // => { sound: 'woof', legs: 4 }  
Babel Compiler v6.4.4 Copyright (c) 2014-2015 Sebastian McKenzie