0

For example I have:

const O1 = {a:1, b:2, c:3, d:4};

And I want a new object like:

const O2 = {a:O1.a, d:O1.d}

I can do it this way but,

const {a, d} = O1;
const O2 = {a, d}; // Can I do this without writing out all the values again?
FluffyBeing
  • 295
  • 1
  • 7
  • 25

0 Answers0