Skip to content

Commit 9d0e267

Browse files
committed
Explaing console.log uses and properties
1 parent 87f5865 commit 9d0e267

1 file changed

Lines changed: 11 additions & 8 deletions

File tree

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
1-
## Objects
2-
31
In this activity, we'll explore some additional concepts that you'll encounter in more depth later on in the course.
42

5-
Open the Chrome devtools Console, type in `console.log` and then hit enter
3+
Open the Chrome devtools Console, type in console.log and then hit enter
64

75
What output do you get?
6+
It gives the expression : ƒ log() { [native code] }
87

9-
Now enter just `console` in the Console, what output do you get back?
10-
11-
Try also entering `typeof console`
8+
Now enter just console in the Console, what output do you get back?
9+
It gives the expression: console {debug: ƒ, error: ƒ, info: ƒ, log: ƒ, warn: ƒ, …} with all the methods or functions that can be used for debugging.
10+
Try also entering typeof console
11+
It gives the string "object"
1212

1313
Answer the following questions:
1414

15-
What does `console` store?
16-
What does the syntax `console.log` or `console.assert` mean? In particular, what does the `.` mean?
15+
What does console store?
16+
It stores a list of methods that can used in the browser's developer tools.
17+
18+
What does the syntax console.log or console.assert mean? In particular, what does the . mean?
19+
Console.log means that you are accessing the log method of the console object. The dot (.) is called the member access operator or dot notation, it is used to access methods inside an object. it tells javascript to look inside the object on the left to get the method on the right.

0 commit comments

Comments
 (0)