Mid JavaScript

What are IIFEs (Immediately Invoked Function Expressions)?

Functions that execute immediately after being defined.

Example:

(function() {

console.log("Runs instantly!");

})();

Used to create private scopes before let and const.

More from JavaScript Tutorial

All questions for this course