3

Is there a more concise way of rewriting this code:

const { foo, bar } = oldObj;
const newObj = { foo, bar };

as one-line?

Wilhelm
  • 1,407
  • 5
  • 16
  • 32

1 Answers1

-4
const newObj = Object.assign({}, oldObj);
Ben Aston
  • 53,718
  • 65
  • 205
  • 331