# JavaScript Overview – Variables

Variables are used to define a symbolic name for an object or a value, and allows it to be referred to by its symbolic name. Within JavaScript, there are two types: primitive types and object types. Every variable refers to a primitive value (number, string, true/ false, null or undefined) or an object, which is defined as a non-primitive value.

Variables are declared with the var keyword, as shown in the examples below:

                var aBc, zz32;
    var q = "abc", r = 'f';
    var p = true, q = false;

Variables are either scoped globally or functionally. A variable declared outside of any functions has a global scope. A variable declared in a function is available only within the body of the function.