FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [View Raw Code]   [Original HTTPS Page]

Awesome-JavaScript-Interviews/Javascript/IIFE.md at master · fe-collection/Awesome-JavaScript-Interviews · GitHub

Latest commit

 

History

History
executable file
·
9 lines (8 loc) · 533 Bytes

File metadata and controls

executable file
·
9 lines (8 loc) · 533 Bytes

IIFE

  • Immediately-invoked function expressions.

  • A design pattern used by most popular libraries to place all library code inside of a local scope.

  • No global property is created for the function (anonymous function expression).

  • All of the properties created inside of the function expression are scoped locally.

  • Encapsulation, preserve the global namespace as any variables declared within the function body will be local to the closure but will still live throughout runtime.

  • Benefits:

    • Local scoping.

Back | FazBrowse Home | New Git URL