The most practical way to ask for input is usually through form elements. This is something we'll cover in a future tutorial. Today, we're going to cover two built in methods (or functions) of the Window object. They are
confirm() is a method of the window object which allows you to ask the user to confirm their choice, either okay (true) or cancel/close (false). You can then use the boolean input to trigger functions and other actions within your script.
prompt() is another method of the window object which allows you to prompt the user for an input. You can store the data into a variable, manipulate it, and output it any way and anywhere you'd like.
To fork the fiddle and follow along: https://jsfiddle.net/cqcs72Lw/
Remember to checkout the Resources section below for associated downloadable content, JSFiddle links, and other resources. Watch the video and follow along!