Say, I have an object that looks like this:
const a = { prop1: \"val1\", prop2: \"val2\", prop3: \"val3\", prop4: \"val4\", }
And I wan
You can do:
const a = { prop1: "val1", prop2: "val2", prop3: "val3", prop4: "val4", }; const b = {}; Object.keys(a).forEach(k => b[`something_${k}`] = a[k]); console.log(b);