Let's say I have an object with many props, and I am only interested in props 1,2,3
const { prop1, prop2, prop3, ...rest } = MyObj; //destructure, I know this much.
How do I build a new obj with only those 3 properties using spread, or destructure, or whatever;
the Long way
const myNewObj = {
prop1: prop1,
prop2: prop2,
prop3: prop3
}
The fancy ES6 way ?