Learn JavaScript
Display output on the screen
2.1
Lesson

alert

alert() displays a window with your message. It waits until the user clicks the OK button or presses the Esc key.

We can also use alert to show the result of simple mathematical operations like addition.