Menu

Showing posts with label Function without name. Show all posts
Showing posts with label Function without name. Show all posts

Immediately Invoked Function Expression (IIFE) in JavaScript

There is a situation where we want to make a function and execute that function immediately at the same place where we have written. These function can be written in JavaScript without any function name. The approach which we follow to do so is called Immediately Invoked Function Expression (IIFE). Let's see an example of this.

(function() {

//write something in IIFE

}

Hence, if a develop come to any point where there is no need to function name then they could use Immediately Invoked Function Expression (IIFE). 

How to write JavaScript function without function name? and Write an immediate invoke function in JavaScript?

Answer of all these questions is Immediately Invoked Function Expression.