Posted by : Sudhir Chekuri Saturday, 10 March 2018

IIFE ( Immediately invoked function expression ) is a function that's executed as soon as it's created. It is a self invoking anonymous function. It has no connection with any events or asynchronous execution.

Syntax:

( function( ) {
     // Code goes here
     // ...
    } )( );

Explanation:

1.  ( function( ) {
     // Code goes here
     // ...
    } )( );

All the code inside the function will be converted into an expression.

2.  ( function( ) {
     // Code goes here
     // ...
    } )( );

The second pair of parentheses calls the function resulting from the expression.

Its most common usage is to limit the scope of a variable made via var or to encapsulate context to avoid name collisions.


{ 1 comments ... read them below or add one }

  1. Really helpful post, I appreciate the effort put into sharing this information. For learners aiming to build a strong career in enterprise solutions, Placement Point Solutions offers excellent SAP MM Training in Chennai, one of the best locations to gain practical knowledge.

    SAP MM Training in Chennai

    ReplyDelete

Followers

Total Pageviews

Powered by Blogger.

- Copyright © 2013 DevStudent - Metrominimalist - Powered by Blogger - Designed by Johanes Djogan -