js change key of every object in collection code example
Example 1: js rename property
function renameProperty(obj, oldName, newName) {
obj[newName] = obj[oldName];
delete obj[oldName];
}
Example 2: js rename property
obj.newProperty = obj.property
delete obj.property