title: Anonymous function VS const function - javascript
body: <p>Following from this discussion: </p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/34179260/what-is-the-most-efficient-way-to-declare-functions-in-javascript">What is the most efficient way to declare functions in Javascript?</a></li>
  </ul>
  
  <p>I have a doubt about function declaration in JavaScript. </p>
  
  <p>By anonymous function declaration I mean something like this (<a href="https://en.wikibooks.org/wiki/JavaScript/Anonymous_Functions" rel="noreferrer">https://en.wikibooks.org/wiki/JavaScript/Anonymous_Functions</a>):</p>
  
  <pre><code>var myFunction = function (fruit){
      alert('I like ' + fruit);
  }
  </code></pre>
  
  <p>and by const I mean this:</p>
  
  <pre><code>const myfunction = (fruit) =&gt; alert('I like ' fruit);
  </code></pre>
  
  <p>Is it faster to use an anonymous function, or use a const? I have read that using const allows for compile optimizations in JavaScript. Is there any reason why I should use one instead of the other?</p>
  
  <p>Is this even relevant?</p>