3

Is there a more concise way of rewriting this code:

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

as one-line?

Wilhelm
  • 1,357
  • 4
  • 15
  • 30

1 Answers1

-3
const newObj = Object.assign({}, oldObj);
Ben Aston
  • 49,455
  • 61
  • 188
  • 322