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-2/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
@@ -8,8 +8,17 @@ Let's try an example.
8
8
In the Chrome console, invoke the function `alert` with one argument, the string `"Hello world!"`;
9
9
10
10
What effect does calling the `alert` function have?
11
+
alert is a function name and we are storing Hello world! as the argument. alert then alerts the screen with a banner with chrome url that says "Hello world!"
11
12
12
13
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`.
13
14
15
+
when using prompt and input the argument "what is your name?" and press enter we get a text box where it asks for your name(because of the variable) and a cancel and ok button. you input the question, the function is what prompt() gives back and that is the return value.
16
+
14
17
What effect does calling the `prompt` function have?
18
+
19
+
the prompt function displays a pop-up input box asking "what is your name?" prompt asks a question and users give an input and the prompt then returns that input.
20
+
21
+
15
22
What is the return value of `prompt`?
23
+
24
+
we need to create a variable first ' const myName = prompt ("what is your name?"); that stores the returned value in the variable.
0 commit comments