const obj = {
'aaa': {id: 1, text: 'smthng'},
'bbb': {id: 2, text: 'smthng'},
'ccc': {id: 3, text: 'smthng'},
};
 
obj['bbb'].text = 'nonono';
 
 
 
const change = (id) => {
const {[id]: _, ...rest} = obj;
console.log(rest);
};
 
 
change('aaa')
Code will run automatically after changes.
Code runs in an isolated environment.