I am trying to deconstruct an object and apply the variables taken out into it's own object.
e.g. Object beforeTest contains a, b, c, d
I want to take { a, b } out and add it to afterTest object.
Something like...
let afterTest = { a, b } = beforeTest
The following works but isn't very pretty when you have many variables.
let { a, b } = beforeTest;
let afterTest = Object.assign({}, a, b); //EDIT: This doesn't actually do what I intended, see comment on my question
Anyone know of a nicer way to write this?
Thanks