Q. Consider the following code snippet :
var scope = "global scope";
function checkscope() {
var scope = "local scope";
function f()
{
return scope;
}
return f;
What is the function of the above code snippet?

  • (A) Returns value null
  • (B) Returns exception
  • (C) Returns the value in scope
  • (D) None of the mentioned
πŸ’¬ Discuss
βœ… Correct Answer: (C) Returns the value in scope
Explanation: The above code snippet returns the value in scope.
Explanation by: Mr. Dubey
The above code snippet returns the value in scope.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
148
Total Visits
πŸ“½οΈ
2 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
85%
Success Rate