UX Design and Development course

JavaScript Variables

Let's learn variables:

A variable is a simple reference to a larger value. Simply put, a variable is a placeholder.

Syntax for a variable

  • var - defines statement
  • = - assignment operator
  • value - what is assigned to the variable
  • var x = 100;

Variables are case sensitive. All vars need to start with an underscore or a letter, vars CANNOT start with numbers. Only use letters, numbers and underscores.

JS Bin