Skip to content

Commit 6cb823c

Browse files
committed
Update chrome.md
Answered questions and tried alert and prompt on chrome dev tool.
1 parent 499906a commit 6cb823c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,19 @@ Let's try an example.
1010
In the Chrome console,
1111
invoke the function `alert` with an input string of `"Hello world!"`;
1212

13+
1314
What effect does calling the `alert` function have?
15+
// It pauses the webpage until you click OK.
16+
1417

1518
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`.
19+
// const myName = prompt("What is your name?");
20+
// Shows a pop-up asking: "What is your name?" and lets the user type a string.
21+
1622

1723
What effect does calling the `prompt` function have?
24+
// A dialog box pops up with the message you provide (in this case, "What is your name?").
25+
// The webpage is paused while this dialog is open — you can’t interact with the page until you respond.
26+
1827
What is the return value of `prompt`?
28+
// prompt returns the value that the user types if they click OK. eg. if the user types "Shay", the return value is "Shay" (a string) and if the user clicks cancel without typing anything, the return value is null.

0 commit comments

Comments
 (0)