Skip to content

Commit cd05719

Browse files
committed
JS code trying
1 parent 9082058 commit cd05719

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

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

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,26 @@ What effect does calling the `alert` function have?
1515
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`.
1616

1717
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'.
38+
39+
40+

0 commit comments

Comments
 (0)