30 ms·
From the answers to the first intermediate quiz: // These are functions // used as closures... // This is good (function() { var foo = '
by minikomi 14y ago
From the answers to the first intermediate quiz:
// These are functions
// used as closures...
// This is good
(function() {
var foo = 'bar';
})();
This, to me, seems an odd use of the word closure. Since no value is "closed over" with a function in the internal scope and preserved, it is simply an anonymous function being immediately invoked.
That said, these quizzes are a good way to learn but man does JavaScript have a lot of traps.