title: javascript - Transpiling ES6 arrow functions or named functions - what is better?
body: <p>The ECMAScript 6 standard added many new features to the JavaScript language, including a new <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions" rel="nofollow noreferrer">arrow function</a> notation. </p>
  
  <p>At the moment I transpile my code to es6. Now there are sometimes two options. And I wonder which one is the better.</p>
  
  <p>Use a named function if possible: </p>
  
  <pre><code>document.getElementById('rotate').addEventListener('change', function rotate() {
    rotate(parseInt(this.value, 10));
  });
  </code></pre>
  
  <p>Use a arrow function if possible:</p>
  
  <pre><code>document.getElementById('rotate').addEventListener('input', (event) =&gt; {
    rotate(parseInt(event.target.value, 10));
  });
  </code></pre>
  
  <p>Up to know I now this </p>
  
  <p>named function </p>
  
  <ul>
  <li>It is possible to see the function name in an error stack.</li>
  </ul>
  
  <p>Arrow functions</p>
  
  <ul>
  <li>Simple syntax.</li>
  </ul>
  
  <p>Are there any other advantages or disadvantages</p>