How does IIFE work in JavaScript? 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"