Skip to content

Commit efc61f0

Browse files
committed
Completed the stretch-explore tasks in folder 4
1 parent e18f838 commit efc61f0

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@ 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+
It is used to alert the user about something very important. One cannot access the rest of their screen until they manually turn it off (that's why it should only be used when no other way of notification would do the job).
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?
1516
What is the return value of `prompt`?
17+
It also pops up/overlays the screen, in this case it asks the user to input some data. The return value of the prompt is the one specified in the variable attached to it (in this case,"Diana").

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

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

910
Now enter just `console` in the Console, what output do you get back?
11+
console {debug: ƒ, error: ƒ, info: ƒ, log: ƒ, warn: ƒ, …}
1012

1113
Try also entering `typeof console`
1214

1315
Answer the following questions:
1416

1517
What does `console` store?
18+
It stores the things shown above: errors, warnings, messages, info
1619
What does the syntax `console.log` or `console.assert` mean? In particular, what does the `.` mean?
20+
I found that console.assert prints an error message only if a given condition is false (unlike console.log), in which case the `.` might mean the point from which they differentiate.

0 commit comments

Comments
 (0)