JSFiddle - React, Tailwind, and code Playground
JavaScript
var test = [{
"key/1": "Value1",
"key/2": "Value2"
}, {
"key/1.1": "Value1.1",
"key/2.1": "Value2.1"
}, {
"key/1.2": "Value1.2",
"key/2.2": "Value2.2"
}, {
"key/1.3": "Value1.3",
"key/2.3": "Value2.3"
}];
for (var i = 0; i < test.length; i++){
Object.keys(test[i]).reduce(function (a, b) {
test[i][b.toString().replace('/', '-')] = test[i][b];
delete test[i][b];
}, 1);
}
console.log(test);