In this lesson, we will learn how to use the prompt function to ask the user for input and then display that input using console.log.
The prompt function shows a dialog box with a message and an input field where the user can type something. The value entered by the user is returned by the function.
Run the code below to see how prompt works!
Output (Console)