Skip to content

Commit 8e06726

Browse files
Add answers for chrome.md stretch exercise
1 parent 4eab121 commit 8e06726

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,22 @@ Now try invoking the function `prompt` with a string input of `"What is your nam
1313

1414
What effect does calling the `prompt` function have?
1515
What is the return value of `prompt`?
16+
17+
### Answers
18+
19+
**Line 10 — What does calling `alert` do?**
20+
21+
When you call `alert`, a small popup box appears on the screen with the
22+
message you gave it. Nothing else on the page works until you click OK.
23+
24+
**Lines 14-15 — What does calling `prompt` do? What is its return
25+
value?**
26+
27+
When you call `prompt`, a small popup box appears with a question and
28+
a
29+
text box. The user can type an answer and click OK. Whatever they
30+
typed
31+
comes back to your code as text (a string).
32+
33+
If the user clicks Cancel instead, they get nothing back — you get a
34+
special value called `null`, which just means "no value".

0 commit comments

Comments
 (0)