iife
(function () {
statements
})();
iife
(function () {
statements
})();
javascript Immediately Invoked Function Expression
result = (function(a, b){
return a - b;
})(100, 42);
console.log(result); // 58
iife
(function () {
var aName = "Barry";
})();
// Variable aName is not accessible from the outside scope
aName // throws "Uncaught ReferenceError: aName is not defined"
iife
/*An IIFE (Immediately Invoked Function Expression) is a JavaScript
function that runs as soon as it is defined
*/
(function () {
//write your js code here
});
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us