Skip to content

Commit 3298c33

Browse files
answer 4.4
1 parent d4b3804 commit 3298c33

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

‎Sprint-2/4-stretch-explore/objects.md‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,23 @@ Answer the following questions:
1414

1515
What does `console` store?
1616
What does the syntax `console.log` or `console.assert` mean? In particular, what does the `.` mean?
17+
18+
Answer
19+
20+
When I enter `console.log` in the Chrome DevTools Console, it shows the `log` function.
21+
22+
When I enter `console`, it shows an object containing different properties and methods, such as `log`, `error`, `warn`, and `assert`.
23+
24+
When I enter `typeof console`, the output is `"object"`.
25+
26+
What does `console` store?
27+
28+
`console` stores an object that contains methods used to interact with the browser's developer console, such as `log()`, `error()`, `warn()`, and `assert()`.
29+
30+
What does `console.log` or `console.assert` mean?
31+
32+
The `.` is used to access a property or method that belongs to an object.
33+
34+
For example, `console.log` means accessing the `log` method that belongs to the `console` object. Similarly, `console.assert` accesses the `assert` method of the `console` object.
35+
36+
So, the `.` basically means "access something that belongs to this object."

0 commit comments

Comments
 (0)