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
+23-1Lines changed: 23 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,4 +15,26 @@ What effect does calling the `alert` function have?
15
15
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`.
16
16
17
17
What effect does calling the `prompt` function have?
18
-
What is the return value of `prompt`?
18
+
What is the return value of `prompt`
19
+
20
+
>alert("Hello World!")
21
+
the pop up box:chrome://new-tab-page says Hello world! i press ok button, return undefined.the pop up box pauses JS execution until press ok
22
+
<.undefined
23
+
>myName = prompt("What is your name")
24
+
<.'ping'
25
+
Warning: Don’t paste code into the DevTools Console that you don’t understand or haven’t reviewed yourself. This could allow attackers to steal your identity or take control of your computer. Please type ‘allow pasting’ below and press Enter to allow pasting.
26
+
allow pasting
27
+
>let myName = prompt("What is your name?");
28
+
the pop up box:chrome://new-tab-page says, i ingnore blue box just press cancel,
29
+
<.console.log("Your name is:", myName);
30
+
VM255:2 Your name is: null
31
+
undefined
32
+
>let myName = prompt("What is your name?");
33
+
in pop up box: chrome://new-tab-page says, i put my name'ping' in blue box then press ok
34
+
<.console.log("Your name is:", myName);
35
+
VM259:2 Your name is: ping
36
+
undefined
37
+
The value returned from prompt() is stored in the variable myName. The pop up box pauses the JS execution until i press the button either'cancel' or put my name before press'OK'.
0 commit comments