1
00:00:00,990 --> 00:00:03,330
And welcome to this video.

2
00:00:03,570 --> 00:00:10,140
In this video I will be introducing you to Java's group variables.

3
00:00:10,140 --> 00:00:21,660
What are their Borse in Javascript javascript variables are containers for storing data values in order

4
00:00:21,660 --> 00:00:28,230
to create a variable in need to use the VAR key word which is spelled fee.

5
00:00:28,260 --> 00:00:28,650
Ah.

6
00:00:28,680 --> 00:00:31,140
He has to be in lower case.

7
00:00:31,470 --> 00:00:39,150
Also when you quit variables creating a variable means declaring variables is the same P When you declare

8
00:00:39,150 --> 00:00:45,210
variables you have to assign value to variables.

9
00:00:45,220 --> 00:00:52,180
You use the equal sign to assign values to a variable.

10
00:00:52,260 --> 00:00:59,880
For example if I wanted to create a variable x I'm going to give it a value of 7.

11
00:01:00,030 --> 00:01:10,110
Also if I want to create a variable called See My car I give it a value of poche When you are creating

12
00:01:10,140 --> 00:01:20,190
variables is always a good practice to name your variables clues lead to what they are going to store.

13
00:01:20,220 --> 00:01:22,990
The type of data they're going to store.

14
00:01:23,000 --> 00:01:23,960
Poor example here.

15
00:01:23,970 --> 00:01:24,840
And then there's variable.

16
00:01:24,840 --> 00:01:32,890
My car which is an indication that the type of data storing is related to cars.

17
00:01:33,100 --> 00:01:35,700
No it is a difference in the two values here.

18
00:01:35,700 --> 00:01:40,560
This one here the value 7 which is a number and it is here.

19
00:01:40,560 --> 00:01:42,630
The value here is support.

20
00:01:42,900 --> 00:01:46,960
And I've put quote around it where you are declaimed variables.

21
00:01:46,980 --> 00:01:53,650
If you are declaring a text you have to enclose it in quotes.

22
00:01:53,790 --> 00:01:57,700
You either have to use single quotes or double quotes.

23
00:01:57,750 --> 00:02:02,940
You can't mix them you can't use a single quote here and then a double quote here.

24
00:02:03,210 --> 00:02:08,910
That's the only way the computer will understand that it is dealing with a text.

25
00:02:08,910 --> 00:02:11,970
You need to enclose the values in quotes.

26
00:02:12,000 --> 00:02:16,190
You don't need to do that with numbers but a computer knows that is a number.

27
00:02:16,200 --> 00:02:21,250
But if you want the computer to know that is a string they call it this string in programming.

28
00:02:21,370 --> 00:02:24,930
If you want to know that this is a string in it or lose it.

29
00:02:25,230 --> 00:02:30,440
It's also not is of use semicolons here which is important.

30
00:02:30,570 --> 00:02:38,610
That indicates that that is the end of that statement a javascript program is basically a collection

31
00:02:38,760 --> 00:02:40,050
of state.

32
00:02:40,190 --> 00:02:42,040
In the case this is one statement.

33
00:02:42,300 --> 00:02:46,410
This indicate this is another step in because of the semicolon.

34
00:02:46,440 --> 00:02:48,690
So you have to do that.

35
00:02:48,750 --> 00:02:50,660
Are you declaring variables.

36
00:02:50,850 --> 00:02:55,500
You can also declare variables without a sign them value.

37
00:02:55,680 --> 00:03:00,650
So when you declare a variable without a value it is known as on defined.

38
00:03:01,080 --> 00:03:09,030
Once you have defined or declared a variable you can change its value.

39
00:03:09,240 --> 00:03:12,150
For example here have already defined the variable called my car.

40
00:03:12,160 --> 00:03:17,430
If I wanted to change the value from poche for example to a range rover all I need to do is call the

41
00:03:17,430 --> 00:03:25,000
variable by name and assign it different value so that we already change the value once you declare

42
00:03:25,040 --> 00:03:25,530
a variable.

43
00:03:25,530 --> 00:03:37,680
You can change the value a variable that is declared without a value is known as on define it also is

44
00:03:37,680 --> 00:03:43,140
very important to know that javascript is case sensitive.

45
00:03:43,290 --> 00:03:46,620
So for example here declare this variable.

46
00:03:46,620 --> 00:03:49,510
My car car with a key.

47
00:03:49,530 --> 00:03:53,750
See if I tried to reference it with a lower case c..

48
00:03:53,910 --> 00:03:55,080
It will not work.

49
00:03:55,080 --> 00:04:02,800
You can experiment with javascript inside your web browser.

50
00:04:03,660 --> 00:04:13,530
If you are using a Mac you can access to a web browser console by clicking on option command and G.

51
00:04:13,700 --> 00:04:15,700
Why do you call the web browser open.

52
00:04:15,780 --> 00:04:22,410
If you are on a Windows computer and once you've got the Web browser open you can just press F 12 that

53
00:04:22,410 --> 00:04:25,220
will give you the web console.

54
00:04:25,240 --> 00:04:34,620
I have got the Google home page open so I'm going to access the web console just by hitting the 12 on

55
00:04:34,620 --> 00:04:38,170
the keyboard and that would give me the console.

56
00:04:38,340 --> 00:04:44,060
This is the developer console where you can experiment with a script.

57
00:04:44,370 --> 00:04:47,920
So there are different ways you can dock it.

58
00:04:48,060 --> 00:04:55,650
If you click here at the moment the doctor decide you can also dock it to the button and that will give

59
00:04:55,650 --> 00:04:59,520
you the page to web page you currently view and then you can text.

60
00:04:59,960 --> 00:05:01,760
With the cord on the side.

61
00:05:02,240 --> 00:05:06,470
All he can do it on this side dock it to the left.

62
00:05:06,470 --> 00:05:13,160
So depending on where you fancy you can lock it wherever you like.

63
00:05:13,160 --> 00:05:22,300
I am going to just dock it on the net for now so let's try an experiment wait some Jabr scrip So I'm

64
00:05:22,310 --> 00:05:26,980
going to declare a variable inside the console here.

65
00:05:27,050 --> 00:05:30,040
Just type in the art to declare a variable.

66
00:05:30,360 --> 00:05:34,010
I'll give the variable in them off thanks.

67
00:05:34,370 --> 00:05:37,240
Give it the value of 7.

68
00:05:38,060 --> 00:05:42,590
So now if I want to call this variable all I need to do is call the variable by his name.

69
00:05:42,650 --> 00:05:47,050
If I press X it will return the value of 7.

70
00:05:47,360 --> 00:05:51,570
Now that I have declared the variable I can also change its value.

71
00:05:51,890 --> 00:05:55,250
All I need to do is call it by its name.

72
00:05:55,250 --> 00:05:59,320
Use a post to assign different value.

73
00:05:59,330 --> 00:06:07,610
Now if I quote variable x again in the longer still 7 but in our stores the same thing I declare another

74
00:06:07,610 --> 00:06:14,210
variable called Let's declare a new variable and when a call is variable.

75
00:06:14,390 --> 00:06:16,300
My car.

76
00:06:17,870 --> 00:06:18,650
K.

77
00:06:23,120 --> 00:06:24,080
My car.

78
00:06:24,350 --> 00:06:30,060
OK in I'll give it my car and I'm going to give it a value off.

79
00:06:31,650 --> 00:06:36,630
See porsh.

80
00:06:39,660 --> 00:06:40,440
Okay.

81
00:06:40,560 --> 00:06:44,650
And amid the semicolon to end that.

82
00:06:44,770 --> 00:06:54,740
So now if I call these variable by its name if I see for example if I call call it by car.

83
00:06:56,060 --> 00:06:57,080
It will not work.

84
00:06:57,080 --> 00:06:57,930
You know why.

85
00:06:57,980 --> 00:07:03,780
Because I represented in lower case you know this I use this in upper case.

86
00:07:04,010 --> 00:07:09,460
So it is very important that you referenced variables the way you've defined them.

87
00:07:09,490 --> 00:07:12,580
Find the hard core back and call it again.

88
00:07:13,410 --> 00:07:22,520
With Casey it should return right because he's giving me a value of poche and once you declare the variable

89
00:07:22,520 --> 00:07:26,070
you can easily change its name change its value.

90
00:07:26,360 --> 00:07:32,290
So if I want to change that to something else I'll just call it my name.

91
00:07:32,550 --> 00:07:37,250
So I want to change it to a Ford for example.

92
00:07:40,900 --> 00:07:43,980
It can do a semicolon.

93
00:07:43,980 --> 00:07:44,870
Now that's changed.

94
00:07:44,880 --> 00:07:53,080
If I call the variable again by name it will no longer store render a vote for now storing fraud.

95
00:07:53,340 --> 00:08:01,620
So these are some of the basic examples you can use to play around in the browser consider the conses

96
00:08:01,620 --> 00:08:08,040
very useful for playing around with little little looking values like this so you can experiment and

97
00:08:08,040 --> 00:08:09,590
get acquainted.

98
00:08:09,690 --> 00:08:14,080
So that's it for this feed you on Javascript variable.

99
00:08:14,160 --> 00:08:15,190
Many thanks.

100
00:08:15,330 --> 00:08:16,250
Bye for now.
