what is the difference between the below two syntaxes?
- by Hari
1.
$(function () {
function foo() { return true; }
log(bar()); // getting error
var bar = function() { return true; };
});
2.
$(function () {
function foo() { return true; }
log(bar()); // working
function bar() { return true; };
});
in above snippets log is my custom function to log the result.