title: Are named functions preferred over anonymous functions in JavaScript?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/336859/javascript-var-functionname-function-vs-function-functionname">JavaScript: var functionName = function() {} vs function functionName() {}</a>  </p>
  </blockquote>
  
  
  
  <p>There are two possible methods for pulling out a function in Javascript:</p>
  
  <pre><code>var foo = function() { ... }
  </code></pre>
  
  <p>This is a bit contrived; another common pattern is:</p>
  
  <pre><code>var foo = {
     baz: 43,
     doSomething: function() {
         // ...
     }
  }
  </code></pre>
  
  <p>versus</p>
  
  <pre><code>function foo() { 
    // ... 
  }
  </code></pre>
  
  <p>Is there an explicit reason to prefer one or the other?</p>