Skip to content

Commit 5d0742b

Browse files
authored
I have answered five questions asked in this exercise.
Added explanations about the console object and its methods.
1 parent 48d4945 commit 5d0742b

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,28 @@ Open the Chrome devtools Console, type in `console.log` and then hit enter
66

77
What output do you get?
88

9+
1. I got back, 'ƒ log() { [native code] }'
10+
which is the definition of console function.
11+
912
Now enter just `console` in the Console, what output do you get back?
1013

14+
2. I got back, console {debug: ƒ, error: ƒ, info: ƒ, log: ƒ, warn: ƒ, …}
15+
Which is the definition of console as an object with several examples of functions after the object.
16+
1117
Try also entering `typeof console`
1218

19+
3. I've got 'object', it is showing me that console itself is an object.
20+
1321
Answer the following questions:
1422

1523
What does `console` store?
24+
25+
4. The object console stores different functions used for various purposes, such as debugging, showing errors etc.
26+
1627
What does the syntax `console.log` or `console.assert` mean? In particular, what does the `.` mean?
28+
29+
5. console.log allows you access the log property of the console object. ie log is a property stored inside the object. In this case log as a function.
30+
31+
console.assert - assert is another function stored inside console object, used for checking is a condition is true.
32+
33+
"." means go inside this property and get the property provided. Perfect example of this is, "person" is an object, "name" is a property and so "." allows me to access the property.

0 commit comments

Comments
 (0)