On 7. 2. 2020 13:11, Scott Rudiger wrote:
`Array.prototype.filter` seems more versatile (although it doesn't
mutate the original array) since it removes elements based on a function:
```js
[1, 2, 3, 2, 1].filter(n => n !== 1); // [2, 3, 2]
```
But what if one wants to mutate in-place. Would this work?
Object.assign(arr, arr.filter(n => n !== 1))
If not, maybe there can be
aCollection.replaceWith(anIterable)
Herby
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss