fix(curriculum): update questions for console.log() lecture (#58803)

This commit is contained in:
Ange Karara Mbabazi
2025-02-14 12:37:49 +02:00
committed by GitHub
parent 5b0f491c52
commit 76c0b29b14
@@ -42,35 +42,35 @@ The `console.log()` method helps you monitor your code as it runs, making it eas
## --text--
What does the `console.log` method do in JavaScript?
What does the `console.log()` method do in JavaScript?
## --answers--
It alerts the user.
It audits your code for errors and displays the results in the browser console.
### --feedback--
Think about where you can see the results of the `console.log` method.
Think about where you can see the results of the `console.log()` method.
---
It displays output in the browser console.
It is used to log data and display the output in the browser console.
---
It stores values in a database.
It stores values in a database as well as the browser console.
### --feedback--
Think about where you can see the results of the `console.log` method.
Think about where you can see the results of the `console.log()` method.
---
It changes the HTML content on the page.
It changes the HTML content on the page and shows the changes in the browser console.
### --feedback--
Think about where you can see the results of the `console.log` method.
Think about where you can see the results of the `console.log()` method.
## --video-solution--
@@ -78,35 +78,40 @@ Think about where you can see the results of the `console.log` method.
## --text--
Which of the following examples correctly uses `console.log` to display the value of a string?
What will be logged to the console?
```js
const age = 10;
console.log(age);
```
## --answers--
`console.log("Hello!");`
`10`
---
`console.write("Hello!");`
`"10"`
### --feedback--
Pay attention to the syntax of the `console.log` method.
Remember that `console.log()` will log the value of that variable.
---
`log.console("Hello!");`
`age`
### --feedback--
Pay attention to the syntax of the `console.log` method.
Remember that `console.log()` will log the value of that variable.
---
`console.output("Hello!");`
`"age"`
### --feedback--
Pay attention to the syntax of the `console.log` method.
Remember that `console.log()` will log the value of that variable.
## --video-solution--
@@ -114,35 +119,35 @@ Pay attention to the syntax of the `console.log` method.
## --text--
How would you use `console.log` to display the value of a variable called `age`?
Why is `console.log()` helpful when building out web applications?
## --answers--
`console.print(age);`
It is commonly used to check the performance for an application and see the results in the console.
### --feedback--
Think about the basic structure of `console.log` and where the variable should go.
Review the beginning of the video where this was discussed.
---
`console.log(age);`
It is commonly used by developers for debugging and inspecting values or expressions in their code during development.
---
`log.console(age);`
It is commonly used to check for linting errors in your code and display those errors in the console.
### --feedback--
Think about the basic structure of `console.log` and where the variable should go.
Review the beginning of the video where this was discussed.
---
`console.log("age");`
It is commonly used to ensure that your JavaScript code is adhering to best practices.
### --feedback--
Think about the difference between a variable and a string.
Review the beginning of the video where this was discussed.
## --video-solution--