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?

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? Correct Answer Returns the value in scope

Answer: Option 3

The above code snippet returns the value in scope.

Related Questions

Consider the following code snippet function printprops(o) { for(var p in o) console.log(p + ": " + o[p] + "n"); } What will the above code snippet result ?
If A = x% of y and B = y% of x, then which of the following is true?
What is the value of var? $var = 'HELLO WORLD!'; $var = ucfirst($var);
Consider the following code snippet var sets = com.davidflanagan.collections.sets; What is the programmer trying to do in the above code snippet?
Consider the following code snippet function tail(o) { for (; o.next; o = o.next) ; return o; } Will the above code snippet work? If not, what will be the error?