Skip to content

Commit 982244f

Browse files
chrome and objects commit
1 parent 878dae9 commit 982244f

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,12 @@ Let's try an example.
88
In the Chrome console, invoke the function `alert` with one argument, the string `"Hello world!"`;
99

1010
What effect does calling the `alert` function have?
11+
Answer An alert popped up
1112

1213
Now try invoking the function `prompt` with a string input of `"What is your name?"` - store the return value of your call to `prompt` in an variable called `myName`.
1314

1415
What effect does calling the `prompt` function have?
16+
Answer A popup prompts me to write my name.
17+
1518
What is the return value of `prompt`?
19+
Answer The value i entered in the text box.

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,19 @@ 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+
Answer The output is ƒ log() { [native code] }
89

910
Now enter just `console` in the Console, what output do you get back?
11+
Answer console {debug: ƒ, error: ƒ, info: ƒ, log: ƒ, warn: ƒ, ...} but i can't copy it.
12+
1013

1114
Try also entering `typeof console`
15+
Answer It shows object'
1216

1317
Answer the following questions:
1418

1519
What does `console` store?
20+
console is an object with properties that are function values. These functions are called methods because they belong to the console object.
21+
1622
What does the syntax `console.log` or `console.assert` mean? In particular, what does the `.` mean?
23+
console.log means "access the log method from the console object" and console.assert means "access the assert method from the console object.

0 commit comments

Comments
 (0)