jquery - Filter an array with two comparisions -
i filtering array using .filter
, example:
stack_wr = stack_wr.filter(function(obj2) { return obj2.class != sec__id; });
the above code works require. question can filter using 2 comparisons or return
statements? 1 obj2.class != sec__id
have done , again obj2.type != whatever_value
or have filter 2 times way have done below:
stack_wr = stack_wr.filter(function(obj2) { return obj2.class != sec__id; }); stack_wr = stack_wr.filter(function(obj2) { return obj2.type != whatever_value; });
did try
stack_wr.filter(function(){ return this.classname !== 'email' && this.type !== 'password'; });
Comments
Post a Comment