fix(curriculum): update questions in Debugging techniques lecture (#60359)

Co-authored-by: Tom <20648924+moT01@users.noreply.github.com>
This commit is contained in:
Supravisor
2025-05-20 09:36:47 +12:00
committed by GitHub
parent 8c1610a1ed
commit efc3b3faed

View File

@@ -66,35 +66,35 @@ As you continue to build out your JavaScript programs, test out the `debugger` s
## --text--
What happens when JavaScript encounters the `debugger` statement during code execution?
What is the `debugger` used for?
## --answers--
It skips the line and continues executing the code.
Fixing and debugging code.
### --feedback--
Think about how JavaScript behaves when you need to pause and inspect the code.
Think about how you can inspect code and quickly identify where things might be going wrong.
---
It logs an error message in the console.
Highlighting code with incorrect syntax.
### --feedback--
Think about how JavaScript behaves when you need to pause and inspect the code.
Think about how you can inspect code and quickly identify where things might be going wrong.
---
It immediately pauses execution, allowing you to inspect variables and the flow of the code.
Pausing code execution.
---
It restarts the code from the beginning.
Highlighting undeclared variables.
### --feedback--
Think about how JavaScript behaves when you need to pause and inspect the code.
Think about how you can inspect code and quickly identify where things might be going wrong.
## --video-solution--
@@ -138,35 +138,43 @@ Think about how browsers handle pausing and resuming code.
## --text--
Which tab do Chrome and Firefox browsers switch to when they encounter the `debugger` statement?
What will be the output of the following code while the console is open?
```js
let firstNumber = 23;
let secondNumber = 4;
debugger;
let sum = firstNumber + secondNumber;
console.log(sum);
```
## --answers--
Chrome switches to the Network tab, and Firefox switches to the Console tab.
`27`
### --feedback--
Think about where you typically inspect and debug your code.
Think about what the `debugger` statement is used for.
---
Chrome switches to the Elements tab, and Firefox switches to the Memory tab.
`sum`
### --feedback--
Think about where you typically inspect and debug your code.
Think about what the `debugger` statement is used for.
---
Chrome switches to the Source tab, and Firefox switches to the Network tab.
The code execution pauses at the `debugger` statement.
---
Both switch to the Performance tab.
A syntax error is thrown.
### --feedback--
Think about where you typically inspect and debug your code.
Think about what the `debugger` statement is used for.
## --video-solution--