0

I was wondering if there's a way to assign part of an object to another by destructuring it, and realized I don't understand how assignment works. Greatly appreciate any advice!

const obj = { foo, bar } = { foo: 1, bar: 2, baz: 3 }
// => { foo, bar, baz }
// Was hoping for => { foo, bar }
Sean
  • 331
  • 1
  • 6

0 Answers0