title: How to change what an ES6 arrow function's 'this' points to?
body: <p>In the <code>traverse</code> npm package there's this example</p>
  
  <pre><code>var obj = [ 5, 6, -3, [ 7, 8, -2, 1 ], { f : 10, g : -13 } ];
  
  traverse(obj).forEach(function (x) {
      if (x &lt; 0) this.update(x + 128);
  });
  </code></pre>
  
  <p>Inside the callback function you can call <code>this.update</code>. I know in these kinds of cases you should use the regular (not ES6 arrow) style of  function definitions like shown above.</p>
  
  <p>But out of curiosity, how would you make that code work with ES6 arrow function syntax? If I try as follows I get <code>TypeError: Cannot read property 'update' of undefined</code> because of course <code>this</code> is not the same as above.</p>
  
  <pre><code>traverse(obj).forEach((x) =&gt; {
      if (x &lt; 0) this.update(x + 128);
  });
  </code></pre>
  
  <p>I tried to change <code>this</code> by using <code>bind</code> but wasn't successful. How do you change <code>this</code> in ES6 arrow functions?</p>