Welcome back to the Bite-Sized Advanced Javascript series, where we discuss advanced JavaScript concepts in an easy-to-understand and concise fashion.

The first time you heard the statement Immediately Invoked Function Expression (IIFE), you might have been a little intimidated. But, like many JavaScript concepts, it’s fairly straightforward and not as scary as it sounds.

Before we get into the weeds of what IIFEs are and what they’re used for, it’s important to go over a little vocabulary.

Understanding the concept of function statements vs. function expressions is critical to fully understand and appreciate the concept of IIFEs.

Let’s jump right in.

Function Statements

Put simply, a function statement will start with the word function when it’s defined. Example:

//Function statement

function greet(name) {
   console.log(‘Hello ‘ + name)
}
greet(“Colton”)
//Hello Colton

#javascript #programming #coding #software-development #software-engineering

JavaScript Under The Hood Pt. 7: IIFEs
1.10 GEEK