Variables

From CodeStuff
Jump to: navigation, search

Variables are used in programming to hold values. In JavaScript you make a variable with var.


Putting a value into a variable is easy, just use =.


You can make a variable and give it a value all in one line


Using JavaScript, you can place any value into a variable,


When I said "any value" I really meant it. Watch this one.


Changing the value of a variable is as simple as putting another variable into it.


Because variable can change value you can use them to hold information about what the program is doing right now. For example you can use them to count how many times the program has done something.