Guest User

Untitled

a guest
Dec 2nd, 2014
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Assumes you're using either .apply or this is used as a member function
  2. function containsAll(predicates) {
  3.   var collection = this;
  4.   _.filter(collection, function(item) {
  5.     for (var i = 0, L = predicates.length; i < L; i++) {
  6.       if (!predicates[i](item) return false;
  7.     }
  8.     return true;
  9.   });
  10. }
Advertisement
Add Comment
Please, Sign In to add comment