when to use IIFE in JS code example
Example: iife javascript
var result = (function () {
var name = "Barry";
return name;
})();
// Immediately creates the output:
result; // "Barry"
var result = (function () {
var name = "Barry";
return name;
})();
// Immediately creates the output:
result; // "Barry"