Here is an example of a variable:
var greeting = "Hello";
Here's what the page does:
stores the text Hello! into a variable named greeting. The semicolon ; is used to indicate the end of a statement (instruction).
uses a function to show the user a message. We'll learn about functions later.
A variable is a way to store a value (number, text, etc.). The reason we store values is to help us do things with those values.
Analogy: People have names, and those names are used when you want to refer to a specific person. A variable is a way to give a name to a value, so you can refer to it later.
Variables can store strings (text):
var fruits = ['banana', 'pineapple', 'peach', 'strawberry'];