Q: 5
A developer is asked to fix some bugs reported by users. To do that, the developer adds
a breakpoint for debugging.
Function Car (maxSpeed, color){
This.maxspeed =masSpeed;
This.color = color;
Let carSpeed = document.getElementById(‘ CarSpeed’);
Debugger;
Let fourWheels =new Car (carSpeed.value, ‘red’);
When the code execution stops at the breakpoint on line 06, which two types of information are
available in the browser console ?
Choose 2 answers:
Options
Discussion
C/D? Pretty sure at the breakpoint you can inspect carSpeed (the element) and access localStorage in the console, since global objects are always available. Haven't seen exam questions specifically mention instance counts or object tracking like B. Anyone else seen something similar on the exam reports?
Hate how these exam questions get so nitpicky about scope and timing. Option C and D.
Why would A be correct? The debugger hits before fourWheels exists, so can't inspect its value yet.
C D tbh, A and B won't show up due to where the code stops. Small detail but matters for this breakpoint.
Its C and D. You won’t get an instance count like B, and A is tricky but only the DOM element properties are exposed at that line.
C and D make sense. Browser console lets you check the carSpeed element's attributes plus global stuff like window.localStorage, even if fourWheels isn't set yet. Pretty sure that's the intent but open to corrections.
Option C and D
Call it C and D here. The code stops right before fourWheels gets created, so you can only access carSpeed's DOM info plus things like window.localStorage. I think that's what they're getting at, but open to other takes.
C and D for me. You can use the browser console to check the style, attributes, and event listeners from carSpeed at that debugger line, plus window.localStorage is always accessible. The other options don't match what you get at that point in execution. If anyone checked the official docs or hands-on labs, let me know if I'm missing something.
A/B tbh, seen similar on other exams where those are the ones you can check.
Be respectful. No spam.