Saturday, 31 August 2013

What are the usage scenarios or advantages of defining functions after the return expression

What are the usage scenarios or advantages of defining functions after the
return expression

En example can be found in Twitter'a typeahead.js here:
function () {
// ...
return this.each(initialize);
function initialize() {
// ...
}
}
Questions:
What are the scopes and what function sees what?
What is the reason for using such a construct (usage scenarios and
advantages)?

No comments:

Post a Comment