Mark As Completed Discussion

Let's test your knowledge. Click the correct answer from the options.

What would be the output of the following code snippet?

JAVASCRIPT
1const scopeCheck = () => {
2    let localScope = "LOCAL";
3    const innerScopeCheck = () => {
4        let innerLocalScope = "INNER LOCAL";
5        return globalScope + " { " + localScope + " { " + innerLocalScope + " }} ";
6    }
7    console.log(innerLocalScope);
8    return innerScopeCheck;
9}
10//let globalScope = "GLOBAL";
11//Function returning function
12let fun1 = scopeCheck();
13console.log(fun1());

Click the option that best answers the question.

  • undefined
  • scopeCheck() is not defined
  • GLOBAL { LOCAL { INNER LOCAL } }
  • ReferenceError: innerLocalScope is not defined