I have this :
for (const key of Object.keys(filter)) {
}
Problem is that sometimes i get key with suffix _1, and than i have:
keyName_1{
prop:'prop1'
}
And when i call service this keyName_1 is a problem, so what i want is always to replace this keyName1. I tried this :
for (const key of Object.keys(filter)) {
if(key.includes('_1')){
key.replace('_1','');
}
}
But then i lose object values of that key, so my prop does not exists anymore. Is there any option to change only key name?.