A variable is a container/box for storing data values.
You give variable a name, then give it a value. When you call or use that name it will return what it has inside of it.
- Create a variable
var message = "Hello World";
b) message is the variable name (you can name anything )
c) “Hello World” is a string data type (for now just remember it as plain text )
So all together this: var message = “Hello World”; is called a statement.
Now let’s see what we have in this statement. Read the following.
1) Variable Declaration
When we wrote var message;
This is called variable declaration.
It’s just fancy word for saying create a variable
Remember that this is also a statement.
2) Assign Value
Now we can take the variable that we created var message;
and assign a value to it like so:
message = "Hello World";
So here = is called the assignment operators.
That’s it for this tutorial. Watch the video from my Youtube Channel for practical use.