Lexical Scope
Lexical Scope
Lexical scope means a function's variable access is determined by where the function is written. Calling a function from another place does not lend it that caller's local variables.
This rule makes code predictable. You can read the source and know which outer names a function can use.
Your task: Read the commented code in the starter. Predict the value returned by runReport(), and assign it to prediction.
Free with a JS Exercises account
Sign in to start coding, run your solution, and keep your progress saved for later. No payment needed.
By continuing, you agree to our Terms and Privacy Policy. We'll send occasional product updates and news. You can unsubscribe anytime.
Lexical Scope
Lexical scope means a function's variable access is determined by where the function is written. Calling a function from another place does not lend it that caller's local variables.
This rule makes code predictable. You can read the source and know which outer names a function can use.
Your task: Read the commented code in the starter. Predict the value returned by runReport(), and assign it to prediction.