mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-06-19 21:09:51 +08:00
fix(curriculum): update questions in Debugging techniques lecture (#60359)
Some checks failed
i18n - Build Validation / Validate i18n Builds (20) (push) Has been cancelled
CI - Node.js / Lint (20) (push) Has been cancelled
CI - Node.js / Build (20) (push) Has been cancelled
CI - Node.js / Test (20) (push) Has been cancelled
CI - Node.js / Test - Upcoming Changes (20) (push) Has been cancelled
CI - Node.js / Test - i18n (italian, 20) (push) Has been cancelled
CI - Node.js / Test - i18n (portuguese, 20) (push) Has been cancelled
i18n - Download Client UI / Client (push) Has been cancelled
i18n - Upload Client UI / Client (push) Has been cancelled
i18n - Upload Curriculum / Learn (push) Has been cancelled
Some checks failed
i18n - Build Validation / Validate i18n Builds (20) (push) Has been cancelled
CI - Node.js / Lint (20) (push) Has been cancelled
CI - Node.js / Build (20) (push) Has been cancelled
CI - Node.js / Test (20) (push) Has been cancelled
CI - Node.js / Test - Upcoming Changes (20) (push) Has been cancelled
CI - Node.js / Test - i18n (italian, 20) (push) Has been cancelled
CI - Node.js / Test - i18n (portuguese, 20) (push) Has been cancelled
i18n - Download Client UI / Client (push) Has been cancelled
i18n - Upload Client UI / Client (push) Has been cancelled
i18n - Upload Curriculum / Learn (push) Has been cancelled
Co-authored-by: Tom <20648924+moT01@users.noreply.github.com>
This commit is contained in:
parent
8c1610a1ed
commit
efc3b3faed
@ -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--
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user