A named container that stores a value you can use and change in your code.
A variable is a named container for storing data in your program. Think of it like a labeled box: you give it a name, put something inside, and can reference it later by name. In JavaScript, you create variables with let (can change), const (cannot change), or var (older style).
Variables can hold numbers, text (strings), lists (arrays), objects, booleans, and more. Variables have Scope — they are only accessible within certain parts of your code. TypeScript adds type checking to variables. JSX embeds variables in UI templates. Linting tools catch variable naming issues. Code editors highlight variables with syntax coloring.
Understanding variables is the first fundamental concept in programming.
Learn the concepts, fix things with confidence, and ship real products with AI beside you. No coding background required, and we're with you from the first idea to launch.
Free to start. No card. Leave whenever you want.