Sometimes, we want to execute
a function as soon as it is defined.
For these purposes, we can use IIFE
which is an Immediately Invoked
Function Expression.
The variables declared inside the IIFE
cannot be accessed from outside the IIFE.
Using traditional function definition,
an IIFE would like this:
You can also execute the traditional function expression
as shown in the example below.
The location of the executing parentheses
does not change the output.
Immediately Invoked Function Expressions
are not commonly used.
They should only be used if
there is a specific reason to use them.