title: Javascript: point-free style in callback
body: <p>So I wanted the elements of the array <code>arr1</code> that also happen to belong to the array <code>arr2</code>. I figured <code>arr1.filter(arr2.includes)</code> should do the trick, but it gave me an error (see below). Strangely, though, <code>arr1.filter(x =&gt; arr2.incudes(x))</code> worked fine. Even though the functions <code>arr2.includes</code> and <code>x =&gt; arr2.includes(x)</code> aren't referentially equal, shouldn't they take the same values on the same inputs? What am I missing, here?</p>
  
  <pre><code>&gt; arr1 = ['a', 'b', 'c']
  [ 'a', 'b', 'c' ]
  &gt; arr2 = ['a', 'c', 'd']
  [ 'a', 'c', 'd' ]
  &gt;
  &gt; arr1.filter(x =&gt; arr2.includes(x))
  [ 'a', 'c' ]
  &gt; arr1.filter(arr2.includes)
  TypeError: Cannot convert undefined or null to object
      at includes (&lt;anonymous&gt;)
      at Array.filter (native)
      at repl:1:6
      ... etc ...
  </code></pre>