An Immediately-invoked Function Expression (IIFE for friends) is a way to execute functions immediately, as soon as they are defined.
It is also known as self executing function.
/**
syntax for IIFE
*/
(function(){
/**
write code here
*/
})()
Example:
(function(){
console.log("Example for IIFE");
})()