What is IIFEs?

What is IIFEs?

A soon as the given function is created, it invokes itself. It doesn’t need to get invoked explicitly.
For Eg :-

  var iife = function (){
    return 'I am called';
  }();
  console.log(iife); // 'I am called'

An Immediately Invoked Function Expression is a good way at protecting the scope of your function and the variables within it.