I have a JavaScript object as follows:
var a = { Prop1: \'test\', Prop2: \'test2\' }
How would I change the \"property name\" of Prop1 to P
Adding to the object rest spread solution
const { Prop1: Prop3, ...otherProps } = a; const newObj = { Prop3, ...otherProps };