EXAMINATION DOCUMENT 2026/2027
D276 Web Development Foundations
Exam 5 2026/2027 - JavaScript
Fundamentals DOM Events - 210 Q&A; - A+
Graded - Latest Update This Year - Just
Released - Verified Solutions - Pass
Guaranteed
A+ VERIFIED | WGU D276 | HTML5 CSS3 JavaScript
, Table of Contents
1. Exam Overview & Study Approach .......................................................... 4
2. JavaScript Basics - Variables, Declaration, Scope ...................................... 5
3. Data Types & Type Coercion Essentials ................................................. 12
4. Operators, Expressions & Control Flow ................................................. 19
5. Functions, Scope, Closures & Hoisting ................................................ 27
6. DOM Fundamentals - Selecting & Traversing ............................................ 38
7. DOM Manipulation - Create, Update, Delete .............................................. 49
8. Events - Bubbling, Capturing & Delegation ............................................ 62
9. Event Listeners - Options, Removal & Best Practices ................................. 75
10. Form Validation, Regular Expressions & Error Handling .............................. 87
11. JSON, Fetch API, Storage & Modern ES6+ ............................................. 98
12. Practice Exam - 210 Q&A; - Questions 1-70 ........................................... 105
13. Practice Exam - 210 Q&A; - Questions 71-140 ......................................... 145
14. Practice Exam - 210 Q&A; - Questions 141-210 ........................................ 185
15. Answer Key - Balanced A/B/C/D Distribution ........................................ 225
, D276 Web Development Foundations
Exam 5 - JavaScript Fundamentals DOM
Events
210 Q&A; - WGU Objective Assessment Prep
1. Which keyword declares a block-scoped variable that can be reassigned in ES6+?
A. let - block-scoped mutable
B. var - function-scoped legacy
C. const - block-scoped immutable binding
D. static - not a JS declaration keyword
Correct Answer: A
Rationale: let is ES6 block-scoped and allows reassignment, unlike const which prevents reassignment. var is
function-scoped and hoisted, causing leaks. Block scope restricts visibility to {} and prevents redeclaration
errors. For WGU D276, prefer let for mutable loop counters and const for constants. This distinction reduces
bugs and aligns with modern best practices for variable lifecycle management in JavaScript applications. WGU
D276 emphasizes modern JS best practices, browser DevTools debugging, and separation of concerns.
Practice coding examples in VS Code with live server, inspect console logs, and validate HTML5 semantics to
solidify exam readiness for objective assessment success.
2. What is result of typeof null due to legacy bug in JavaScript?
A. 'null'
B. 'object' - legacy bug
C. 'undefined'
D. 'number'
Correct Answer: B
Rationale: typeof null returns 'object' due to legacy implementation bug where null was represented as zero,
sharing object tag. Though null is a primitive, this quirk remains for compatibility. Correct null checks need ===
null. typeof undefined is 'undefined'. D276 tests this trap. Remember arrays also return 'object', so use
Array.isArray for arrays and strict equality for null checks, essential for accurate type checking. WGU D276
emphasizes modern JS best practices, browser DevTools debugging, and separation of concerns. Practice
coding examples in VS Code with live server, inspect console logs, and validate HTML5 semantics to solidify
exam readiness for objective assessment success.
3. Which JSON method is used to convert JavaScript object with nested data case 3 to
transport string?
A. JSON.parse() serializes object to string
B. Object.toString() produces valid JSON
C. JSON.stringify() serializes object to string, JSON.parse() deserializes
D. JSON.encode() standard browser method
Correct Answer: C
Rationale: In client-server workflow, JSON.stringify converts JS object to JSON string for fetch body or
localStorage.setItem, while JSON.parse converts JSON string back to object. localStorage stores only strings,
so conversion required. JSON requires double-quoted keys, no functions. Case 3 illustrates persistence:
localStorage.setItem('user', JSON.stringify(user)). On load, JSON.parse(localStorage.getItem('user')). Handle
circular refs and date reviver for robust D276 storage implementation. WGU D276 emphasizes modern JS best