@@ -4,13 +4,50 @@ In this activity, we'll explore some additional concepts that you'll encounter i
44
55Open the Chrome devtools Console, type in ` console.log ` and then hit enter
66
7+ console.log
8+ ƒ log() { [native code] }
9+ Explanation:
10+ This output indicates that console.log is a function provided by the browser (native code). You are seeing the function itself, not executing it.
11+
12+
713What output do you get?
814
915Now enter just ` console ` in the Console, what output do you get back?
1016
17+ console
18+ and press Enter, the Console shows something like:
19+
20+ console {debug: ƒ, error: ƒ, info: ƒ, log: ƒ, warn: ƒ, …}
21+ Explanation:
22+ This output shows that console is an object containing multiple methods, such as:
23+
24+ * log
25+ * error
26+ * warn
27+ * info
28+ * debug
29+
30+ Each of these properties is a function that can be used to output messages to the Console in different ways.
31+
1132Try also entering ` typeof console `
1233
34+ typeof console
35+ 'object'
36+
1337Answer the following questions:
1438
1539What does ` console ` store?
1640What does the syntax ` console.log ` or ` console.assert ` mean? In particular, what does the ` . ` mean?
41+
42+ console is an object
43+
44+ It stores methods (functions)
45+
46+ . is used to access properties or methods on an object
47+
48+ log / assert → a property of console (in this case, a function)
49+
50+ console stores an object.
51+ This object contains properties and methods (mostly functions) provided by the browser for debugging, such as log, error, warn, info, and assert.
52+
53+
0 commit comments