Variable part 3

Using Variables



Let's assign a value to a variable and output it to the browser.
var x = 100;
document.write(x);
Try It Yourself

Result:
Using variables is useful in many ways. You might have a thousand lines of code that may include the variable x. When you change the value of x one time, it will automatically be changed in all places where you used it.
Every written "instruction" is called a statement. JavaScript statements are separated by semicolons.
Use the corresponding keyword to complete the statement.

 
 
 my_variable = 32;

Comments

Popular posts from this blog

Comparison Operators part 2

Break and Continue part 1

Module 2