Home / Report Question

Q. What can be done in order to avoid creation of global variables in JavaScript?
  • A. To use a method that defines all the variables
  • B. To use an object that has the reference to all the variables
  • C. To use an object as its namespace
  • D. To use global functions

Correct Answer: C