You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As discussed here currently it is not possible to delete elements in non-javascript arrays. I'd like to ask for the ability to include our own implementation of what a delete operation should do.
JavaScript has a bit unusual semantics when it comes to the deletion of array elements: it removes the element and leaves a hole there. Other languages typically do not support deletion at all or shrink the array (i.e. move the elements to fill the hole and decrease the size of the array/list). That's why we hesitate to implement the general delegation of JavaScript delete operation to a custom/non-javascript remove[ArrayElement]().
A possible workaround is to wrap the non-javascript array in JavaScript proxy, i.e., create JS Proxy whose target is the array and provide a custom deleteProperty trap in the handler of this proxy. Unfortunately, it turned out that there are several bugs that are blocking this approach. I have fixed these bugs and created a simple example of the mentioned approach.
As discussed here currently it is not possible to delete elements in non-javascript arrays. I'd like to ask for the ability to include our own implementation of what a delete operation should do.
Code sample that throws the related error:
The text was updated successfully, but these errors were encountered: