I think you're not getting the answers you're looking for, because maybe you've over simplified the use-case, so it's tempting to just say:
delete object[2]; // which modifies the original object
If your data is not that static, or if you want to do something more complex to remove certain elements, you could do something similar to this:
const relevantObjects = Object.entries(object) // converts each entry to [key, value]
.filter(([k, v]) => v.id !== 2) // define the criteria to include/exclude items
.reduce((acc, [k, v]) => {
acc[k] = v;
return acc; // this function can be improved, it converts the [[k, v]] back to {k: v, k: v, ...}
}, {});
Edit:
It's perfectly fine to use a lib or whatever. Everything has its pros & cons, just do whatever works for you <3