[
{'key1' : 'Kiev', 'key2' : 'Ukraine'},
{'134 ': 'Moskow', 'key2' : 'Rusian federation'},
{'test2' : 'Warszaw', 'key2' : 'Poland'},
{'_test' : 'Paris', 'test' : 'France'},
... итп
]
const keys = [ 'city', 'country' ];
.const newArr = arr.map(n => Object.fromEntries(Object.values(n).map((v, i) => [ keys[i], v ])));
arr.forEach(n => Object.entries(n).forEach(([ k, v ], i) => (delete n[k], n[keys[i]] = v)));
const keys = [ 'city', 'country' ];
arr.map((rawObj) => Object.values(rawObj).reduce((acc, value, index) => {
acc[keys[index]] = value;
return acc;
}, {}));