|
3 | 3 | In this activity, we'll explore some additional concepts that you'll encounter in more depth later on in the course. |
4 | 4 |
|
5 | 5 | Open the Chrome devtools Console, type in `console.log` and then hit enter |
6 | | - |
| 6 | + |
7 | 7 | What output do you get? |
| 8 | + ---------------- ƒ log() { [native code] } |
| 9 | + |
8 | 10 |
|
9 | 11 | Now enter just `console` in the Console, what output do you get back? |
| 12 | + --------------- console |
| 13 | + console {debug: ƒ, error: ƒ, info: ƒ, log: ƒ, warn: ƒ, …} |
| 14 | + methods properties built-in Js devtools which can be useful for debugging and tracking the code |
10 | 15 |
|
11 | | -Try also entering `typeof console` |
| 16 | + |
| 17 | +Try also entering `typeof console` |
| 18 | + ------------- 'object' |
12 | 19 |
|
13 | 20 | Answer the following questions: |
14 | 21 |
|
15 | 22 | What does `console` store? |
| 23 | + ------------ Is an object Js which contains methos and properties for logging information, displaying errors, warnings, debugging in the browser. |
| 24 | + |
16 | 25 | What does the syntax `console.log` or `console.assert` mean? In particular, what does the `.` mean? |
| 26 | + ------------ the dot notation between `console.log` or `console.assert` is the access to method(function) store within the console object. |
| 27 | + |
| 28 | + ---------- eg. With the . operator, we can access the properties in each object within the students array, allowing us to check or modify what’s stored in each object. |
| 29 | + |
| 30 | +let students = [ |
| 31 | + { nombre: "Ana", age: 21 }, |
| 32 | + { nombre: "Luis", age: 22 }, |
| 33 | + { nombre: "Marta", age: 20 } |
| 34 | +]; |
| 35 | + |
| 36 | +console.table(students); |
| 37 | + |
0 commit comments