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

console.log(dog); // => { legs: 4, sounds: 'woof' }
Babel Compiler v6.4.4 Copyright (c) 2014-2015 Sebastian McKenzie