1. To use a method that defines all the variables
  2. To use an object that has the reference to all the variables
  3. To use an object as its namespace
  4. To use global functions

Share with your friends
AhmedNazir

Call

Answer: Option 3

One way for a module to avoid the creation of global variables is to use an object as its namespace. Instead of defining global functions and variables, it stores the functions and values as properties of an object (which may be referenced to a global variable).

Talk Doctor Online in Bissoy App