Hello and welcome.
In this video I'll be introducing you to Java Script assignment operators assignment operators are basically
used to assign values to JavaScript variables.
This is a table or a basic assignment operator.
We have used these so far in this course.
The assignment operator is represented by the equals to sign and that basically assigns a value to a
variable.
For example you can have a variable called X and assign it a value of twenty seven.
There are also other types of assignment operators for example if you add a plus in front of the equals
to sign.
What that will do it will add a variable to another.
So for example here I've got a variable x.
Have other the plot in front of the equals sign and then I've signed it.
The value of y basically that is the same thing as x equals two X plus Y.
You can also add a surprise action sign before the equals 2.
And that also practice if you had a multiplication sign before the equals to sign that or multiply.
If you have a division that will divide if you have a modulus and so on so it operates in the same principle
as the plus and equals to sign works.
So I've got my console open so I'm just going to declare a simple variable and use the assignment operator
to give it a value.
So I'm going to create a variable called Z and I'm going to use the assignment operator to give it a
value of 15.
So the assignment operator has now assigned the variable Z a value of 15.
So if I want to call these variable I just call it by its name which is z and it will return a value
of 15.
Now I can add of some practice to that value.
For example I can call the variable Z and use the plus and a course.
Operator and assign it a value of c 5 that will now give that value 20 you can see the value increase
to 20 so I can also do the opposite.
So I can do variable Z.
Now use the minus and equals to sign and say Make it eight.
That will decrease the value from twenty to twelve.
All right.
And you can do the multiplication the same way and to vision and then modulus.
So that's basically how you use the assignment operator.
But the most popular way to use the assignment operator is just the first example here where I just
assign you use the cost to assign to assign a value to a variable but you can also use it in combination
with the arithmetic operators to add subtract divide and to remainders and all kind of stuff.
So that's basically it for this to do on assignment operators.
Thank you for watching.
Bye for now.