Veda Bites are swipeable micro-lessons — each one teaches exactly one
idea. Here's a taste from this kit; the app has the full deck.
💡 Key Idea
Three Popup Boxes, Three Jobs
One line of JS, instant user interaction.
JavaScript gives you three built-in popup boxes, each designed for a different kind of user interaction.
↳ Pick the box that matches your intent: inform → alert, decide → confirm, collect → prompt.
📖 Definition
alert(): The Simplest Popup
Just want to say something? Use alert.
↳ alert() is fire-and-forget — it shows text and waits for the user to click OK.
💻 Code Example
confirm(): Getting a Yes or No
Ask the user a question they can only answer two ways.
confirm() returns a boolean — `true` if the user clicks OK, `false` if they click Cancel.
↳ Always store confirm()'s return value in a variable — it's your true/false decision.