1const object = { a: 5, b: 6, c: 7 };
2const picked = (({ a, c }) => ({ a, c }))(object);
3
4console.log(picked); // { a: 5, c: 7 }
1var buttons = {
2 foo: 'bar',
3 fiz: 'buz'
4};
5
6for ( var property in buttons ) {
7 console.log( property ); // Outputs: foo, fiz or fiz, foo
8}
1const object = { a: 5, b: 6, c: 7 };const subset = (({ a, c }) => ({ a, c }))(object);console.log(subset); // { a: 5, c: 7 }