I'm trying to remove "personal_" from any object key names.
I tried running a loop and getting the object key name, then using the replace function on it but it doesn't remove the personal_
.
var object = {
active: false,
personal_user_metadata: {
first_name: 'jon',
last_name: 'doe',
},
personal_app_metadata: {
data: 'blah',
},
email: 'jondoe@example.com'
}
for(name in object){
name.replace('personal_', '')
}
console.log(object)