To prevent variables from being added to the global object, it is common to use a(n) _______ function expression.

  • IIFE (Immediately Invoked Function Expression)
  • Arrow
  • Anonymous
  • Prototype
To prevent variables from polluting the global object, an IIFE (Immediately Invoked Function Expression) is commonly used. It encapsulates code within a function scope and immediately executes it, keeping variables private and not accessible from the global scope.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *