It's not very proper to call these closures, is it? Their purpose is not to close around external variables available in the lexical scope.
And I'm ready to upvote the first blog post entitled "the 'considered harmful' meme considered harmful".
And I'm ready to upvote the first blog post entitled "the 'considered harmful' meme considered harmful".
function privateFunction() {
}
that is sugar meaning there is a variable named privateFunction and it points to a function. So the object that is eventually returned closes around these external variables.Here's four variations that hopefully show the difference.
edit: bad link