SHARE
TWEET

Untitled

a guest Dec 2nd, 2014 172 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function(collection, predicates) {
  2.   _.filter(collection, function(item) {
  3.     return allTrue(item, predicates.length-1);
  4.   });
  5.  
  6.   function allTrue(item, predicates, i) {
  7.     return predicates[i](item) && (i > 0) ? allTrue(predicates, i-1) : true;
  8.   }
  9. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top