I have some code where I use getters in an array and I've run into an issue where delete
isn't deleting the element from the array. I'd like to know if there's a way to get delete
working.
Here's some toy code that replicates the issue:
let x = [];
Object.defineProperty(x, 0, {
get: function() {
return;
}
});
delete x[0];
edit: Slicing is actually not an option, it seems, since only the elements themselves and not the getters are copied.