Skip to content

Commit dc12eda

Browse files
Complete chrome.md stretch exercise
1 parent 18a4902 commit dc12eda

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

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

Lines changed: 4 additions & 2 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-
11+
Answer: Calling alert("Hello world!") displays a pop-up dialog box in the browser window containing the message "Hello world!" and an "OK" button that pauses script execution until dismissed.
1212
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`.
13-
1413
What effect does calling the `prompt` function have?
14+
Answer: Calling prompt("What is your name?") displays a pop-up dialog box containing the message, a text input field, an "OK" button, and a "Cancel" button.
15+
1516
What is the return value of `prompt`?
17+
Answer: It returns the string entered by the user in the input field when they click "OK". If the user clicks "Cancel" or closes the dialog, it returns null.

0 commit comments

Comments
 (0)