Javascript : IIFE
Immediately-Invoked Function Expression (IIFE) -creates a function then immediately runs it. -does not pollute the global namespace
These are identical:
(function () {
// code
})();
var temp = function() {
// code
}
temp();
Immediately-Invoked Function Expression (IIFE) -creates a function then immediately runs it. -does not pollute the global namespace
These are identical:
(function () {
// code
})();
var temp = function() {
// code
}
temp();