main.js
1
2
3
4
5
6
7
8
9
10
const style = {
  width: 300,
  marginLeft: 10,
  marginRight: 30
};

const { width, ...margin } = style;

console.log(width);  // => 300
console.log(margin); // => { marginLeft: 10, marginRight: 30 }
Babel Compiler v6.4.4 Copyright (c) 2014-2015 Sebastian McKenzie