Goal: In the "Interactivity with Window Methods" lesson, we learned:
windowmethods perform actions in the browser.
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.
Practice using these
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.