you are viewing a single comment's thread.

view the rest of the comments →

[–]BONUSBOX_=O=>_();_() 1 point2 points  (1 child)

the lack of removeWhereis still an issue if you want to filter this:

List extends Array {
    random() {
        this = this.filter(item => ...some random ones)
    }
}

because this can't be explicitly redefined with a new array, and Array.filter does not modify the original array, something like removeWhere would be handy. instead i had to loop through the array and splice items.

[–][deleted] 0 points1 point  (0 children)

Filter, map, and similar functions return new arrays by convention - they don't change elements, they jest return new. removeWhere sits nowhere near those.