Goal: In the "Interactivity with Window Methods" lesson, we learned:
window
methods perform actions in the browser.window
methods include window.alert()
, window.prompt()
, and window.confirm()
.window
methods.Methods are an important part of programming, and you'll be using them constantly. Get the hang of calling window
methods by completing the practice exercises listed below.
window.alert()
, window.confirm()
, and window.prompt()
methods?window
Methods PracticePractice using these window
methods:
window.alert()
to pop up a dialog box with a warning for the user.window.confirm()
to ask a yes or no question.window.prompt()
to ask a question.window.prompt()
as a variable. All responses entered by a user into a prompt input are saved as strings (even if the user enters 10
, the value is saved as the string, "10"
). Run at least 3 string methods of your choice on the string variable that you create from the prompt.parseInt()
. First, save the response as a new variable and turn it into a number. Then, try turning the response into a number without saving it into a variable.