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
+9Lines changed: 9 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,16 @@ invoke the function `alert` with an input string of `"Hello world!"`;
12
12
13
13
What effect does calling the `alert` function have?
14
14
15
+
1. This function displays a pop-up box with Hello world written on it, with on OK button.
16
+
15
17
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
18
17
19
What effect does calling the `prompt` function have?
20
+
21
+
2. It displays a pop-up box with What's your name written on it and an empty dialog box inside, awaiting my input.
22
+
Also, there are two options of OK and Cancel.
23
+
18
24
What is the return value of `prompt`?
25
+
26
+
3. If I enter my name undefined appears, same if i press the cancel button. Fixed this by adding myName at the end.
27
+
Now the value when i enter my name shows "my name", if i press cancel it shows "null".
0 commit comments