variables

A variable is a container where you can store informations, they are essential for programming languages since they help you to reuse of your information in time.

When you program you'll need a way to save an information and call it multiple times, there are a few reasons why;

Let's define a variable, for example:

Javascript
var minAge = 16;

When you want to use the value 16 you don't have to write every time 16 but you just have to write minAge, doing so you are calling a reference to the value 16.

One of the main benefits it's that if you want to change the value from 16 to 18 you don't have to go in every point of your program to change the informations but you can just change the value from your variable declaration. 

Sometimes you may need to change the value in another point of your program, since you are using a variable and not a costant you just have to change it when you need it.

Javascript
minAge = 18;

Variables are different from constants because you have the possibility to change them.

In some languages a variable is type based that means that is bond to it's type and cannot change type, example:

Java
String a = 'A simple test';

Other languages are dynamic about this matter as the first example with javascript minAge can be changed over time into a string or boolean, you are not bond with your type but it's dynamic.

c javascript c++ java