idea: Array.prototype.remove

#!/JoePea joe at trusktr.io
Mon Feb 4 05:56:10 UTC 2019


I sometimes find myself doing things like

```js
this.children.splice(this.children.indexOf(child), 1)
```

but it seems that it will iterate the array twice. Maybe a new method can
be introduced so engines can optimize it:

```js
this.children.remove(child)
// or
this.children.remove(...childrenToRemove)
```
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20190203/d5b7826a/attachment.html>


More information about the es-discuss mailing list