Let's say there's an object with string values:
const A = { key_a1: "value_a1", key_a2: "value_a2" };
What is the way to clone this object and add some prefix to the values? So I want to convert object A into object B that looks next:
const B = { key_a1: "prefix_value_a1", key_a2: "prefix_value_a2" };
I know about copy syntax like const B = { ...A } but that does not allow to modify values.
mapObject.entries(obj).map(([k,v]) => [k,'prefix_'+v])const B = { ...A }but other then that I'd want to know what my options are. Probably the word "simplest" in the description is just unnecessary.