Skip to content

Instantly share code, notes, and snippets.

@L2L2L
Created December 29, 2017 21:10
Show Gist options
  • Save L2L2L/5c0533bb4e9f6dcb206bbd834f00a88e to your computer and use it in GitHub Desktop.
Save L2L2L/5c0533bb4e9f6dcb206bbd834f00a88e to your computer and use it in GitHub Desktop.
(()=>{
const o = {arr:[1,2,3], obj:{a:1,b:2,c:3}};
const foo{arr:a,obj:o} = o;//making it easy to transfer data from one object to another
console.log(foo);//foo = {a:[1,2,3],o:{a:1,b:2,c:3}}
const bar = {baz:"foo",foo:"bar",bar:"baz"};
const poo = Object.assgin({},bar);//this would be okey if it offer filter in it their argument
const poo = Object.assgin({},bar,["baz","foo"]);
poo//{baz:"foo",foo:"bar"}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment