You've learned about local and global scope. Now let's practice identifying scope patterns and understanding how variables behave in different contexts.
Engagement Message
Ready to become a scope expert?
Type
Multiple Choice
Practice Question
What will this code print?
A. "Inside function" then "Inside function" B. "Inside function" then undefined C. "Inside function" then the code will cause an error D. The code will cause an error immediately
Suggested Answers
- A
- B
- C - Correct
- D
Type
Multiple Choice
Practice Question
What will this code print?
A. "Global" then "Local" B. "Local" then "Global" C. "Global" twice D. "Local" twice
Suggested Answers
- A
- B - Correct
- C
- D
Type
Swipe Left or Right
Practice Question
Match each variable access with whether it will work or cause an error by swiping left or right.
Labels
- Left Label: Will Work
- Right Label: Will Cause Error
Left Label Items
