javascript - remove array element on condition

后端 未结 7 804
北荒
北荒 2020-11-29 05:39

I was wondering how I\'d go about implementing a method in javascript that removes all elements of an array that clear a certain condition. (Preferably without using jQuery)

7条回答
  •  粉色の甜心
    2020-11-29 06:04

    I love these kinds of questions and just a different version from me too... :)

    Array.prototype.removeIf = function(expression) {
       var res = [];
        for(var idx=0; idx 3;
    }
    

提交回复
热议问题