You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Sprint-1/4-stretch-explore/chrome.md
+48-3Lines changed: 48 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,10 +29,10 @@ What effect does calling the `alert` function have?
29
29
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`.
30
30
31
31
32
-
let myName = prompt("hello what is your name")
33
-
alert("hi " + myName)
32
+
let myName = prompt("What is your name");
33
+
alert("hi " + myName);
34
34
35
-
The prompt function displays a modal dialog that captures user input. The value entered is stored in myName, and alert then displays a greeting that includes that value.
35
+
The prompt function displays a modal dialog that captures user input. The value entered is stored in myName, and alert then displays a greeting that includes that value input captured by the variable myName.
36
36
37
37
38
38
What effect does calling the `prompt` function have?
@@ -48,3 +48,48 @@ What is the return value of `prompt`?
48
48
49
49
* Blocks interaction with the page until the user responds
50
50
51
+
If the user types something and clicks OK: It returns a String containing their text.
52
+
53
+
If the user clicks OK without typing: It returns an empty string ("").
54
+
55
+
If the user clicks Cancel or hits Esc: It returns null.
0 commit comments