In case you ever need an readonly nested array to be writable again. It also checks if the object is configurable, TypeError: can't redefine non-configurable property. If it is not configurable there is no other way than to find another solution, such as recreating {...item}
Object.keys(new MyClass()).forEach(field => {
if(Object.hasOwn(item, field)){
// Check if the property is configurable
const descriptor = Object.getOwnPropertyDescriptor(item, field);
if (descriptor && !descriptor.configurable) {
// Make the property configurable
Object.defineProperty(item, field, { writable: true });
}
});