What are IIFEs and why are they used?

Immediately Invoked Function Expressions execute right after defining, often for scoping variables.

(function() {
  const message = "IIFE executed!";
  console.log(message);
})();