title: Passing additional parameters in higher-order functions
body: <p>Consider this example:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const samples = ["foo", "bar"];
  
  const excludeFoos = function(item) {
    return item !== "foo";
  }
  
  const foos = samples.filter(excludeFoos);</code></pre>
  </div>
  </div>
  </p>
  
  <p>How can I pass an <strong>additional</strong> parameter in <code>excludeFoos</code>?</p>
  
  <p>For example:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const samples = ["foo", "bar"];
  
  const exclude = function(item, str) {
    return item !== str;
  }
  
  // obviously won't work but you get the point
  const foos = samples.filter(exclude("foo"));
  console.log(foos); // ["bar"]</code></pre>
  </div>
  </div>
  </p>