mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-04-28 13:00:31 -04:00
fix(curriculum): update last question for let and const lecture (#58694)
This commit is contained in:
committed by
GitHub
parent
65b563607c
commit
81dd64c1bb
@@ -50,35 +50,43 @@ Think about what `const` stands for.
|
||||
|
||||
## --text--
|
||||
|
||||
Which scenario is best suited for using `let` instead of `const`?
|
||||
Which of the following is the correct way to assign the number `100` to a constant named `maxScore`?
|
||||
|
||||
## --answers--
|
||||
|
||||
When you need to declare a configuration value that shouldn't change.
|
||||
```js
|
||||
const maxScore === 100;
|
||||
```
|
||||
|
||||
### --feedback--
|
||||
|
||||
Think about when you'd want to update a variable's value.
|
||||
Refer to the end of the video where this was discussed.
|
||||
|
||||
---
|
||||
|
||||
When you want to track a value that will change during program execution.
|
||||
```js
|
||||
const maxScore = 100;
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
When you want to declare a variable but don't want it to be accessible in a specific block of code.
|
||||
```js
|
||||
const maxScore <= 100;
|
||||
```
|
||||
|
||||
### --feedback--
|
||||
|
||||
Think about when you'd want to update a variable's value.
|
||||
Refer to the end of the video where this was discussed.
|
||||
|
||||
---
|
||||
|
||||
When you want to declare a function.
|
||||
```js
|
||||
const maxScore == 100;
|
||||
```
|
||||
|
||||
### --feedback--
|
||||
|
||||
Think about when you'd want to update a variable's value.
|
||||
Refer to the end of the video where this was discussed.
|
||||
|
||||
## --video-solution--
|
||||
|
||||
|
||||
Reference in New Issue
Block a user