ian5v
0
Q:

iife

(() => {
  // statements
})();
4
result = (function(a, b){
    return a - b;
})(100, 42);

console.log(result); // 58
4
(function () {
    var aName = "Barry";
})();
// Variable aName is not accessible from the outside scope
aName // throws "Uncaught ReferenceError: aName is not defined"
0
/*An IIFE (Immediately Invoked Function Expression) is a JavaScript 
function that runs as soon as it is defined
*/

(function () {
        //write your js code here
});
1

New to Communities?

Join the community