Skip to content

Commit 7764876

Browse files
committed
answering explore objects
1 parent 06fba0d commit 7764876

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Sprint-1/4-stretch-explore/objects.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,22 @@ In this activity, we'll explore some additional concepts that you'll encounter i
55
Open the Chrome devtools Console, type in `console.log` and then hit enter
66

77
What output do you get?
8+
I got ƒ log() { [native code] }
9+
Chrome is telling me console.log a built-in function.
810

911
Now enter just `console` in the Console, what output do you get back?
12+
The output is the console object, which has many built-in methods, such as assert, clear, and context.
1013

1114
Try also entering `typeof console`
15+
The type of console is an object.
1216

1317
Answer the following questions:
1418

1519
What does `console` store?
20+
A console contains its properties, and many of its properties are built-in methods that we can call.
21+
1622
What does the syntax `console.log` or `console.assert` mean? In particular, what does the `.` mean?
23+
The syntax console.log references to the log method built-in the console object, whereas console.assert references to the assert method.
24+
The log method can output message to the console.
25+
The assert method can output a error message when an assertion is false.
26+
In particular, the "." is a accessing method syntax. As a console is an object which has many built-in methods, the "." can refer to the corresponding method after the ".", such as log and assert.

0 commit comments

Comments
 (0)