I have an existing object,
this.data = {
"part": "aircraft",
"subid": "wing",
"information.data.keyword": "test",
"fuel.keyword": "lt(6)"
}
What I'm trying to do is to check every key
and if the key has .keyword
then I am trying to delete it and create it without .keyword
. I am not sure how to rename and push to an existing object.
what I have tried so far,
for(let x in this.data) {
if(x.includes('.keyword')) {
let xy = x.replace(/.keyword/g, "");
console.log(xy);
}
}