Skip to content

Commit 5bb384f

Browse files
author
Ogbemi mene
committed
chrome solution
1 parent 25c9548 commit 5bb384f

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

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

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,21 @@ 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-
8+
console.log + Enter: You will see something like ƒ log() { [native code] }.
99
Now enter just `console` in the Console, what output do you get back?
10-
10+
console + Enter: You will see an expandable drop-down list displaying a massive list of built-in features like clear, error, info, log, warn, etc.
1111
Try also entering `typeof console`
12-
12+
typeof console + Enter: The console will return the string "object".
1313
Answer the following questions:
1414

1515
What does `console` store?
16+
The console object stores a collection of properties and methods (functions) that allow you to interact with the browser's debugging console. Instead of storing just a single value (like a number or string), it acts as a container for tools that let you log text, display errors, format data into tables, and run assertions.
17+
1618
What does the syntax `console.log` or `console.assert` mean? In particular, what does the `.` mean?
19+
The . (Dot): This is known as the dot notation operator. In JavaScript, it is used to access the properties or methods stored inside an object. You can think of it like an address or a path: Object.Property.
20+
21+
The Syntax: * console.log means: "Go to the console object, and find the log method inside it."
22+
23+
console.assert means: "Go to the console object, and find the assert method inside it."
24+
25+
Analogy: Think of console as a literal toolbox, and the dot (.) as the act of reaching inside it. console.log means you are reaching into the console toolbox to grab the log tool.

0 commit comments

Comments
 (0)