Skip to content

Commit 4b2b429

Browse files
committed
Complete objects stretch task
1 parent dbf28af commit 4b2b429

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,11 @@ Try also entering `typeof console`
1313
Answer the following questions:
1414

1515
What does `console` store?
16+
`console` stores the browser's debugging object. It contains methods such as `log`, `error`, `warn`, and `assert` that let us print values and inspect program state.
17+
1618
What does the syntax `console.log` or `console.assert` mean? In particular, what does the `.` mean?
19+
The `.` is the property access operator. It means "look inside the `console` object and use the `log` or `assert` method stored there".
20+
So `console.log(...)` means “call the `log` method on the `console` object”.
21+
22+
Try also entering `typeof console`.
23+
This returns `"object"`, because `console` is an object containing methods.

0 commit comments

Comments
 (0)