Skip to content

Commit 6c4bfa2

Browse files
committed
stretch explore commit
1 parent e87bd36 commit 6c4bfa2

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,11 @@ In the Chrome console,
1111
invoke the function `alert` with an input string of `"Hello world!"`;
1212

1313
What effect does calling the `alert` function have?
14+
Answer: It creates a pop up window on the browser.
1415

1516
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`.
1617

1718
What effect does calling the `prompt` function have?
19+
Answer: It creates a pop up window which allows the user to input data. This prompt has a cancel and an 'OK' button.
1820
What is the return value of `prompt`?
21+
Answer: The return value will depend on what the user inputs. If the user presses the 'cancel' button, then the return is null. If the user presses 'OK' without entering anything, then the return type is an empty string. Else if something is written by the user, then the return value will be what the user has entered.

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

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

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

1113
Try also entering `typeof console`
14+
Answer: object
1215

1316
Answer the following questions:
1417

1518
What does `console` store?
19+
Answer: Console stores a lot of objects like assert, clear, error, info, warn, log, debug and more.
20+
1621
What does the syntax `console.log` or `console.assert` mean? In particular, what does the `.` mean?
22+
Answer: Console.log helps to print out a message.
23+
Console.assert writes an error message to the console if the assertion is false. If the assertion is true, nothing happens.
24+
`.` is used to access the properties or methods of an object

0 commit comments

Comments
 (0)