In plain words
A variable is a name your code gives to a value, like a cart total or a user's email, so it can read or change it later.
Where you see it
Open any file your agent wrote and you'll find lines starting with const or let. In Chirp, const MAX_POST_LENGTH = 280 is a variable: change that one line and every character counter in the app follows.
What goes wrong
- Using const for a value that has to change
The first time the code tries to update it, the app stops with "Assignment to constant variable".
const total = 0; total = total + price; - The same number typed into several files
The agent hard-codes the delivery fee in the cart, the checkout and the receipt. You update one, and the totals stop agreeing.
- Names like data, temp or x
You can't tell what the value is without tracing it back. Names such as unpaidOrders or maxGuests explain themselves.
What to tell your agent
Quick check
Sign in to earn +10 XP for itQuickBite's menu shows a 2.99 delivery fee, but checkout charges 3.49. Most likely cause?