What is IIFE ?

What is IIFE (IFFY) used in Javascript world ? and why is this concept so important ?

Default Asked on October 24, 2016 in Javascript.
Add Comment
  • 1 Answer(s)

    This is “Immediately Executed Function Expression”.  Also known as self executed anonymous function.

    Basically, this type of expressions are being used to avoid creating global variables, which will allow public access to them. One of the best practices used by developers today.

     (function() {
     var str = 'Hello world';
     console.log(str);
     })();
     
    Train Answered on October 24, 2016.
    Add Comment

    Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.