Q. What is the function of this code snippet?

Code:
var scope = "global scope";
function checkscope() {
var scope = "local scope"; 
function f() 
{ 
     return scope; 
}
return f;
  • (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

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
242
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Tanmay
Publisher
πŸ“ˆ
90%
Success Rate