what is the difference between the below two syntaxes?
<p>1.</p>

<pre><code> $(function () {
       function foo() { return true; }
       log(bar());                        // getting error
       var bar = function() { return true; };   
  });
</code></pre>

<p>2.</p>

<pre><code>$(function () {
        function foo() { return true; }
        log(bar());                        // working 
        function bar() { return true; };  
});
</code></pre>

<p>in above snippets <strong>log</strong> is my custom function to log the result.</p>
