I have a set of simple objects contained within an array:
var myObject1 = [
{name: "value1", adddress: "545454545445"},
{name: "value2", adddress: "323233223"},
{name: "value3", adddress: "33232"}
];
My goal is to transform the keys of each object using values from another array:
const myObject = [
['aa', 'name'],
['bb', 'address']
];
What would be the approach to achieve the desired outcome?
[
{ aa: 'value1', bb: '54545455454' },
{ aa: 'value2', bb: '3232323233' },
{ aa: 'value3', bb: '33232' }
]