title: Filter by list of tests
body: <p>What is the concise, functionally-oriented way of filtering a list of URLs where each item has to pass a list of tests? If the URL matches <em>any</em> of the tests, it should be filtered out.</p>
  
  <p>I currently have:</p>
  
  <pre><code>var _ = require("underscore");
  
  const anchors = [
      {href:"https://example.org/contact"},
      {href:"https://example.org/faq"},
      {href:"https://example.org/contact"},
      {href:"https://example.org/uploads/image-1024x1018.jpg"},
      {href:"https://example.org/wp-json/oembed/1.0/embed?url=example"},
      {href:"https://example.org/author/pm"},
      {href:"https://example.org/wp/wp-login.php?action=lostpassword"},
      {href:"https://example.org/wp/wp-login.php"},
      {href:"https://example.org/feed"},
  ];
  
  const tests = [
      /\/wp\//,
      /\/wp-json\//,
      /\.jpg$/,
      /\.png$/,
      /\.gif$/,
  ]
  
  function testAll(testString){
      let pass = true;
      _.each(tests, t =&gt; {
          if(t.test(testString)) pass = false;
      });
      return pass;
  }
  
  console.log(anchors.map(anchor =&gt; {
      return anchor.href;
  }).filter(anchor =&gt; {
      return testAll(anchor);
  }));
  </code></pre>
  
  <p>But I suspect <code>testAll</code> can be done in a more concise way.</p>