easyMultiple ChoiceObjective-mapped
FC0-U71 Practice Question: A junior developer is tasked with fixing a bug…
A junior developer is tasked with fixing a bug where a variable is unexpectedly undefined. The developer suspects the variable is not within scope. Which programming concept describes where a variable can be accessed?
⚠ Common exam trap
Candidates often confuse 'function' (a code block) with 'scope' (the accessibility region), thinking that simply being inside a function guarantees access, when in reality scope is determined by declaration location and keyword (e.g., `var` vs `let`).
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Scope
Scope is the programming concept that defines the region of code where a variable is accessible. If a variable is unexpectedly undefined, it is often because it was declared outside the current block or function, making it out of scope. In JavaScript, for example, variables declared with `let` or `const` inside a block are not accessible outside that block.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Loop
Why it's wrong here
A loop is used to repeat a block of code, not to define variable accessibility.
- ✓
Scope
Why this is correct
Scope determines the visibility and lifetime of a variable within a program.
- ✗
Data type
Why it's wrong here
Data types define the kind of data a variable can hold, not where it can be accessed.
- ✗
Function
Why it's wrong here
A function is a block of code that performs a task, not a concept for variable accessibility.
Go deeper
Related to this question
About these practice questions
Courseiva writes every FC0-U71 question from scratch — 988 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This FC0-U71 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the FC0-U71 exam.