JSFiddle - React, Tailwind, and code Playground
JavaScript
var a = {
"test123": "A",
"testing/test": "B",
"notest": "C"
};
var b = {
"test123": "Test 123",
"testing": "Testing"
};
var c = {}
for (prop in a) {
console.log(prop);
propParts = prop.split("/");
if(b.hasOwnProperty(propParts[0])) {
c[b[propParts[0]]] = a[prop];
} else {
c[prop] = a[prop]
}
}
console.log(c);