Exam-style question
Try this first
Exploring variable scopes in programming.
Description
Variable Scope
Consider the following code snippet: 'globalVar = 10; function example() { localVar = 5; }'. Identify the scopes of 'globalVar' and 'localVar'.
- a[1]
Explain the scope of 'globalVar'.
Aim for approximately 1 distinct marking point.
- b[2]
Explain the scope of 'localVar'.
Aim for approximately 2 distinct marking points.
0 of 2 parts answered
Answer every part before opening the mark scheme.
Common mistake
No common mistake is linked to this question yet.
