1.

What is the purpose of the dynamic scoping?(a) Variables can be declared outside the scope(b) Variables must be declared outside the scope(c) Variables cannot be declared outside the scope(d) Variable cannot be declared within the functionThis question was addressed to me during an online exam.Asked question is from Closures in section Lexical Structures of JavaScript

Answer»

Correct option is (a) Variables can be DECLARED outside the scope

The best EXPLANATION: Dynamic SCOPING creates variables that can be called from outside the block of code in which they are DEFINED. A VARIABLE declared in this fashion is sometimes called a public variable.



Discussion

No Comment Found

Related InterviewSolutions