1
00:00:00,630 --> 00:00:01,990
Hello and welcome.

2
00:00:02,010 --> 00:00:12,300
In this video I'll be introducing you to Java Script assignment operators assignment operators are basically

3
00:00:12,300 --> 00:00:18,150
used to assign values to JavaScript variables.

4
00:00:18,150 --> 00:00:22,680
This is a table or a basic assignment operator.

5
00:00:22,710 --> 00:00:25,890
We have used these so far in this course.

6
00:00:25,890 --> 00:00:34,680
The assignment operator is represented by the equals to sign and that basically assigns a value to a

7
00:00:34,680 --> 00:00:35,250
variable.

8
00:00:35,250 --> 00:00:42,500
For example you can have a variable called X and assign it a value of twenty seven.

9
00:00:42,510 --> 00:00:52,200
There are also other types of assignment operators for example if you add a plus in front of the equals

10
00:00:52,200 --> 00:00:52,990
to sign.

11
00:00:53,130 --> 00:00:57,960
What that will do it will add a variable to another.

12
00:00:58,020 --> 00:01:01,990
So for example here I've got a variable x.

13
00:01:02,230 --> 00:01:06,660
Have other the plot in front of the equals sign and then I've signed it.

14
00:01:06,660 --> 00:01:13,990
The value of y basically that is the same thing as x equals two X plus Y.

15
00:01:14,010 --> 00:01:20,390
You can also add a surprise action sign before the equals 2.

16
00:01:20,520 --> 00:01:28,320
And that also practice if you had a multiplication sign before the equals to sign that or multiply.

17
00:01:28,800 --> 00:01:38,190
If you have a division that will divide if you have a modulus and so on so it operates in the same principle

18
00:01:38,310 --> 00:01:43,700
as the plus and equals to sign works.

19
00:01:43,710 --> 00:01:51,750
So I've got my console open so I'm just going to declare a simple variable and use the assignment operator

20
00:01:51,810 --> 00:01:53,610
to give it a value.

21
00:01:54,300 --> 00:02:03,390
So I'm going to create a variable called Z and I'm going to use the assignment operator to give it a

22
00:02:03,390 --> 00:02:06,650
value of 15.

23
00:02:07,230 --> 00:02:13,620
So the assignment operator has now assigned the variable Z a value of 15.

24
00:02:14,250 --> 00:02:23,670
So if I want to call these variable I just call it by its name which is z and it will return a value

25
00:02:23,670 --> 00:02:24,930
of 15.

26
00:02:24,930 --> 00:02:29,040
Now I can add of some practice to that value.

27
00:02:29,070 --> 00:02:39,640
For example I can call the variable Z and use the plus and a course.

28
00:02:39,930 --> 00:02:50,460
Operator and assign it a value of c 5 that will now give that value 20 you can see the value increase

29
00:02:50,790 --> 00:02:54,710
to 20 so I can also do the opposite.

30
00:02:54,720 --> 00:02:57,440
So I can do variable Z.

31
00:02:57,630 --> 00:03:06,570
Now use the minus and equals to sign and say Make it eight.

32
00:03:07,230 --> 00:03:12,390
That will decrease the value from twenty to twelve.

33
00:03:12,440 --> 00:03:13,050
All right.

34
00:03:13,240 --> 00:03:19,850
And you can do the multiplication the same way and to vision and then modulus.

35
00:03:19,890 --> 00:03:22,730
So that's basically how you use the assignment operator.

36
00:03:22,740 --> 00:03:30,990
But the most popular way to use the assignment operator is just the first example here where I just

37
00:03:31,050 --> 00:03:38,640
assign you use the cost to assign to assign a value to a variable but you can also use it in combination

38
00:03:38,640 --> 00:03:47,930
with the arithmetic operators to add subtract divide and to remainders and all kind of stuff.

39
00:03:47,970 --> 00:03:53,400
So that's basically it for this to do on assignment operators.

40
00:03:53,400 --> 00:03:54,570
Thank you for watching.

41
00:03:54,750 --> 00:03:55,500
Bye for now.
