mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-03-11 04:01:15 -04:00
fix(curriculum): update questions in Debugging techniques lecture (#60359)
Co-authored-by: Tom <20648924+moT01@users.noreply.github.com>
This commit is contained in:
@@ -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--
|
||||
|
||||
|
||||
Reference in New Issue
Block a user