0

I cannot think of the term that JavaScript developers use for this kind of practice.

 var someSome = (function () { ... } ()); 

-- Wrapping function within brackets. I vaguely remember someone was calling this fiif? fiff?

And there were many advantages and it was recommended java scripting practice.

Anyone got clue what I am talking about and why is it a good practice?

it might have been even without assignment like below

(function () { ... } ()); 
learnNetsuite
  • 47
  • 1
  • 1
  • 5
  • IIFE. Mostly used for just-in-time-style variable declarations (as seen here) and avoiding scope pollution. – Niet the Dark Absol Feb 24 '15 at 03:50
  • Thank you Niet!!! Immediately-Invoked Function Expression (IIFE)Immediately-Invoked Function Expression (IIFE)Immediately-Invoked Function Expression (IIFE)Immediately-Invoked Function Expression (IIFE)Immediately-Invoked Function Expression (IIFE) – learnNetsuite Feb 24 '15 at 03:51

1 Answers1

0

Self executing function. Often used as a wrapper around a function block to immediately invoke it, as well as give it closure.

Rob R
  • 1,011
  • 8
  • 10