All right, let's take a look at assignment operators, and we've seen the first one a lot so far,
so the first one is the straight assignment, which just assigns a value from the right side to the
left side.
So what X equals five is an assignment.
And then we have these other ones that combine assignment in an operation.
So, for example, plus equals.
So what X plus equals five says add five to X an assignment.
So X started out as 10 after you did this.
It would have the value five.
I'm sorry, 15.
And one bad thing about these examples is they shouldn't really have the words let here because you
can't declare a variable and say plus equals five.
So the variable would already have to be declared.
So X plus equals five, X minus equals five and so on.
So we can and this list is much longer than this.
So every operator you can do an assignment equals like this.
So I just covered six and we'll take a look at some examples.
OK, so this should be pretty quick.
Well, do is how to find a variable with value equals five and then I will do one of these operators
with an equals and we'll see the result.
So then I'll say value plus equals two and then I'll slug it out.
All right, let's run the first one.
So now has to buy you seven, because it started out as five, we add two to it and reassign it back.
So let's do this with the other operators plus plus equals minus equals times equals.
Divided equals, percentage equals.
And like I said, there's much more that could be done.
Minus equals, times equals.
And we do the remainder first because otherwise I'm going to have a
fractional number.
All right, let's see what this does.
And we got this to the end and ended up being zero, so so minus two took it back to five times to took
it up to ten, ten remaindered two.
There is no remitters.
That's why that zero and zero divide equals two is still zero.
So let's shake this up a little bit with something divisible by two.
So let's do that.
So now when we do the 21 and the remainder to so the remainder of that one because 21 divided by two
is 10 as an integer with a remainder of one and then one divided by two point five.
So the important thing to remember is that it actually changes the variable and and then there's other
many other possibilities.
So any other operator we've talked about could be that operator equals.
So that is it on operators.
I'm going to put a link to the Mozilla documentation on Operator Precedent's to show you, at least
with the long list of precedents of operators are.
So we know the Times has more precedence than plus and we know that the end has more precedence than
the other.
But it is a long list.