Skip to content

Commit 1795109

Browse files
committed
docs: testing and documentation about behavior of calling a prompt and using and alert.
1 parent 850edaa commit 1795109

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

Sprint-1/explore/chrome.md

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

13+
To invoke an alert that lives in the engine v8; we need to
14+
run `alert("Hi there!")`
15+
16+
1317
What effect does calling the `alert` function have?
1418

19+
In short: alert() interrupts the page to show a message and waits for the user to acknowledge it.
20+
21+
📢 The message you pass to alert() is displayed to the user.
22+
23+
⏸️ JavaScript execution pauses until the user clicks OK.
24+
25+
🚫 The user can’t interact with the page while the alert is open (it blocks the UI).
26+
27+
28+
1529
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`.
1630

31+
32+
let myName = prompt("hello what is your name")
33+
alert("hi " + myName)
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.
36+
37+
1738
What effect does calling the `prompt` function have?
1839
What is the return value of `prompt`?
40+
41+
Calling the prompt() function displays a modal pop-up dialog that:
42+
43+
* Shows a message to the user
44+
45+
* Includes a text input field
46+
47+
* Has OK and Cancel buttons
48+
49+
* Blocks interaction with the page until the user responds
50+

0 commit comments

Comments
 (0)