Variables

In a programming language, variables are used to store data values. In JavaScript, a variable is defined using the var keyword followed by the name of the variable. The code below assigns the text “Gainesville” to the variable named city.

var city = 'Gainesville';

Note that the text string in the code should be surrounded by quotes. You are free to use either ' (single quotes) or " (double quotes), and they must match at the beginning and end of each string. In your programs, it is advisable to be consistent—use either single quotes or double quotes throughout a given script (the code in this book generally uses single quotes for code). Each statement of your script should typically end with a semicolon, although Earth Engine’s code editor does not require it. 

If you print the variable city, you will get the value stored in the variable (Gainesville) printed in the Console. 

print(city);

When you assign a text value, the variable is automatically assigned the type string. You can also assign numbers to variables and create variables of type number. The following code creates a new variable called population and assigns a number as its value.

var population = 140,398;
print(population);

Read more about variables here: https://www.w3schools.com/js/js_variables.asp