title: mouseover not working as an arrow function?
body: <p>I have the function below:</p>
  <pre><code>.on(&quot;mouseover&quot;, function(d, i) {
      d3.select(this)
        .attr(&quot;fill&quot;, &quot;red&quot;);
  })
  </code></pre>
  <p>However, I wanted to try writing it as an arrow function, so I found that this <a href="https://riptutorial.com/d3-js/example/27637/using--this--with-an-arrow-function" rel="nofollow noreferrer">tutorial</a> and got this:</p>
  <pre><code>.on(&quot;mouseover&quot;, (d, i, nodes) =&gt; {
      d3.select(nodes[i])
        .attr(&quot;fill&quot;, &quot;red&quot;);
  })
  </code></pre>
  <p>However, whenever I try running it, I keep getting an error that says <code>TypeError: undefined is not an object (evaluating 'nodes[i]')</code>.</p>
  <p>I have also tried replacing <code>nodes</code> and just calling <code>this</code> but it seems that no matter what I try, arrow functions don't work here. I feel like it shouldn't be a version issue since I'm using v7 of d3. Can anyone explain what the issue is here?</p>
  <p>Thanks in advance!</p>