1
00:00:09,680 --> 00:00:10,220
Hi there.

2
00:00:10,370 --> 00:00:14,300
Let's continue with our exercise would just stop that number five.

3
00:00:14,330 --> 00:00:16,160
So now let's solve.

4
00:00:16,190 --> 00:00:17,240
Number six.

5
00:00:17,840 --> 00:00:22,610
Consider the following variable names and inform which are invalid and why.

6
00:00:22,910 --> 00:00:25,490
I'm going to do this in the age damn male file.

7
00:00:25,790 --> 00:00:28,080
So I have the answers written here.

8
00:00:28,550 --> 00:00:32,240
So let me go back to the HDMI file.

9
00:00:32,450 --> 00:00:33,200
Here it is.

10
00:00:34,300 --> 00:00:35,410
Let me find this.

11
00:00:35,620 --> 00:00:37,360
So here are the variable names.

12
00:00:37,600 --> 00:00:39,010
I'm just going to write.

13
00:00:40,310 --> 00:00:42,080
The ones that are invalid.

14
00:00:42,500 --> 00:00:45,950
So the first one is name, we've all letters in caps.

15
00:00:45,980 --> 00:00:47,480
No problem with this.

16
00:00:47,750 --> 00:00:51,830
I don't like this style for naming variables, but this is valid.

17
00:00:52,670 --> 00:00:53,270
Be.

18
00:00:54,200 --> 00:00:56,080
Dollar sign num one.

19
00:00:56,930 --> 00:00:58,260
This is also valid.

20
00:00:58,280 --> 00:01:02,960
We can use dollar signs, we can use numbers, so no problem again.

21
00:01:03,410 --> 00:01:04,430
Now let us see.

22
00:01:04,790 --> 00:01:06,750
This one is invalid.

23
00:01:11,160 --> 00:01:12,810
Because type of.

24
00:01:14,080 --> 00:01:15,130
Is a reserved.

25
00:01:16,440 --> 00:01:19,080
Word, letter, the first name.

26
00:01:19,500 --> 00:01:22,500
This is also invalid because we have a dash.

27
00:01:22,770 --> 00:01:27,810
We can use underscores, but we can not use dashes so invalid.

28
00:01:29,150 --> 00:01:30,980
Because of.

29
00:01:33,300 --> 00:01:33,930
Bashes.

30
00:01:35,530 --> 00:01:40,570
Letter E attempt underscore to no problem with this one.

31
00:01:41,560 --> 00:01:42,450
Letter F.

32
00:01:42,520 --> 00:01:43,990
This one is invalid.

33
00:01:45,830 --> 00:01:54,240
Because it starts with a number so we can use numbers, but we cannot start with a numbers.

34
00:01:54,290 --> 00:01:56,790
So this is invalid and Ladder G.

35
00:01:57,170 --> 00:01:59,170
This is also invalid.

36
00:02:01,930 --> 00:02:03,430
Because of the empty.

37
00:02:04,960 --> 00:02:05,710
Space.

38
00:02:06,280 --> 00:02:07,630
So by saving this.

39
00:02:07,840 --> 00:02:09,100
And going back there.

40
00:02:10,000 --> 00:02:15,000
If we refresh the page, we can see that now our answers are here.

41
00:02:15,400 --> 00:02:20,410
If you want to make this more visible, you can enclose this in a strong.

42
00:02:21,760 --> 00:02:23,230
Tag like this.

43
00:02:27,130 --> 00:02:29,910
I'm just going to do the same thing for the others.

44
00:02:32,390 --> 00:02:34,970
Let me close this here.

45
00:02:37,660 --> 00:02:39,420
Same thing for this one.

46
00:02:47,800 --> 00:02:51,370
Now, if we save this and refresh the page.

47
00:02:53,090 --> 00:02:55,760
All right, so now we can see our answers better.

48
00:02:56,090 --> 00:02:59,360
So number seven, considered a block of code below.

49
00:02:59,540 --> 00:03:00,490
And guess what?

50
00:03:00,500 --> 00:03:02,930
Values will be shown in the console.

51
00:03:03,410 --> 00:03:10,370
So, again, I'm just going to go to the agency CML and write my guesses and then we can execute the

52
00:03:10,370 --> 00:03:12,650
code and see if this was right.

53
00:03:13,190 --> 00:03:16,210
So let's go to the AGM and file.

54
00:03:16,940 --> 00:03:20,180
We can find this inside this Bre-X element.

55
00:03:20,630 --> 00:03:23,510
So, again, let's get the strong tag.

56
00:03:27,290 --> 00:03:29,620
Let's put it here for our guests.

57
00:03:30,050 --> 00:03:35,390
So now we have vast quantity, no pressure and temperature.

58
00:03:35,750 --> 00:03:42,350
So in the first one, we have quantity and then we have the incremental operator.

59
00:03:43,220 --> 00:03:46,820
So normally this was going to result in 50.

60
00:03:47,090 --> 00:03:50,220
But actually, as you can see, this is a string.

61
00:03:50,240 --> 00:03:54,860
So what happens when we use the incremental operator with strings?

62
00:03:55,100 --> 00:03:57,650
We end up with a concatenation.

63
00:03:58,010 --> 00:04:05,000
So what's actually going to happen here is just concatenating twenty five with twenty five.

64
00:04:14,360 --> 00:04:15,770
OK, second one.

65
00:04:16,040 --> 00:04:19,970
So seven plus five divided by number plus two.

66
00:04:20,210 --> 00:04:26,360
So here we know that the first thing that's going to happen is what is inside the parentheses.

67
00:04:26,630 --> 00:04:30,860
So seven plus five equals twelve.

68
00:04:31,370 --> 00:04:33,770
Then we will have the division.

69
00:04:34,220 --> 00:04:40,340
So twelve divided by six equals two and then two plus two.

70
00:04:40,460 --> 00:04:44,480
My guess is that this is going to result in four.

71
00:04:47,990 --> 00:04:51,350
Now we have the pressure, we just created it.

72
00:04:51,380 --> 00:04:53,360
We did not assign anything.

73
00:04:53,630 --> 00:04:57,890
So if we do sold log, this is going to result in.

74
00:04:59,770 --> 00:05:03,700
Undefined, which is the lack of value of a variable.

75
00:05:03,910 --> 00:05:06,760
Now the same thing for the temperature this time.

76
00:05:06,790 --> 00:05:08,290
If we do this.

77
00:05:09,450 --> 00:05:11,290
We are going to see the No.

78
00:05:12,670 --> 00:05:16,420
Value for the temperature which we assigned to it.

79
00:05:16,990 --> 00:05:19,510
And now the type of these variables.

80
00:05:20,110 --> 00:05:25,210
So the first one we know that undefined is both a value and a type.

81
00:05:25,600 --> 00:05:28,660
So the type is also going to be undefined.

82
00:05:29,770 --> 00:05:33,970
And no is a value, but it's not a data type.

83
00:05:34,360 --> 00:05:41,530
So if we try to get the type of this variable, we know that we're going to get an object in return.

84
00:05:41,770 --> 00:05:43,240
Let's see if this is right.

85
00:05:43,480 --> 00:05:47,590
I'm just going to save this before refreshing the page.

86
00:05:48,160 --> 00:05:49,930
Let's just copy this code.

87
00:05:50,170 --> 00:05:51,100
Go back there.

88
00:05:51,160 --> 00:05:53,100
Go to the J.S. file.

89
00:05:53,140 --> 00:05:55,830
So this is number seven.

90
00:05:59,490 --> 00:06:02,260
So number seven, let's copy all this.

91
00:06:08,300 --> 00:06:10,110
Now, refreshing the page.

92
00:06:10,310 --> 00:06:11,930
We have all the results here.

93
00:06:11,960 --> 00:06:13,430
Let's see if this is right.

94
00:06:14,210 --> 00:06:15,990
So the first one I said.

95
00:06:16,010 --> 00:06:16,790
Twenty five.

96
00:06:16,820 --> 00:06:17,570
Twenty five.

97
00:06:17,600 --> 00:06:19,010
This is correct.

98
00:06:19,370 --> 00:06:20,210
Then four.

99
00:06:20,810 --> 00:06:23,450
Undefined, no undefined.

100
00:06:23,540 --> 00:06:24,770
An object.

101
00:06:25,070 --> 00:06:26,630
So everything's correct.

102
00:06:27,110 --> 00:06:28,760
Now going to the last one.

103
00:06:29,210 --> 00:06:32,570
Do the transformations to the you or else below.

104
00:06:33,980 --> 00:06:38,840
So first, we need to include age DTP as to the string.

105
00:06:39,110 --> 00:06:41,230
We can just do concatenation.

106
00:06:41,480 --> 00:06:43,910
So let's get the ideas of the elements.

107
00:06:45,140 --> 00:06:47,140
So the first one is you were out.

108
00:06:47,240 --> 00:06:47,990
One.

109
00:06:49,090 --> 00:06:50,870
Then we have you around, too.

110
00:06:51,130 --> 00:06:53,650
You are out three and you are out for.

111
00:07:01,050 --> 00:07:02,100
So number eight.

112
00:07:04,480 --> 00:07:08,090
You can just create one variable for each of the results.

113
00:07:08,290 --> 00:07:12,070
So the first result is going to be you are out one.

114
00:07:12,370 --> 00:07:23,580
So here we are going to use document that get element by I.D. and the I.D. is your real one.

115
00:07:24,660 --> 00:07:27,610
So what we need to do here is adding the H.

116
00:07:27,640 --> 00:07:28,610
D to P.

117
00:07:28,740 --> 00:07:29,130
S.

118
00:07:29,160 --> 00:07:31,770
So this is pretty simple to do.

119
00:07:32,130 --> 00:07:34,980
We can just add it right here.

120
00:07:35,160 --> 00:07:41,400
So H CTP s plus the content of that first element.

121
00:07:42,090 --> 00:07:42,660
Now.

122
00:07:46,670 --> 00:07:50,240
We just forgot the inner ASTM, Al.

123
00:07:53,630 --> 00:07:54,830
Now, this is better.

124
00:07:56,000 --> 00:07:57,830
So now let's get this.

125
00:07:59,130 --> 00:08:08,700
And do documents get element by I.D. your are to that inner ASTM al equals, then we can just paste

126
00:08:09,240 --> 00:08:14,820
the you are al that we formed by concatenating the H tdb s..

127
00:08:15,730 --> 00:08:16,290
All right.

128
00:08:16,320 --> 00:08:19,320
Before moving on, let's see if this one is right.

129
00:08:20,160 --> 00:08:21,150
So refreshing.

130
00:08:21,150 --> 00:08:23,490
The page going down there.

131
00:08:23,670 --> 00:08:25,260
We can see that this is working.

132
00:08:25,440 --> 00:08:28,660
So now we need to do the opposite with this one.

133
00:08:28,680 --> 00:08:30,780
We need to remove the HTP.

134
00:08:30,910 --> 00:08:31,450
S.

135
00:08:31,950 --> 00:08:34,590
So I'm just going to copy both lines.

136
00:08:37,080 --> 00:08:38,880
So now you are out to.

137
00:08:42,630 --> 00:08:43,830
It's going to be.

138
00:08:45,940 --> 00:08:52,270
That element which has the idea of you around three, if you want, you can just go back here and check

139
00:08:52,270 --> 00:08:53,260
it by yourself.

140
00:08:53,650 --> 00:08:56,430
As you can see, this is you are out three.

141
00:08:56,740 --> 00:08:58,700
And the next one is you around four.

142
00:08:59,200 --> 00:09:02,080
So here we have the full Google you around.

143
00:09:08,000 --> 00:09:11,870
And now we can just do your L two equals.

144
00:09:12,350 --> 00:09:15,400
You are out two dots replace.

145
00:09:15,710 --> 00:09:16,880
You can do like this.

146
00:09:16,970 --> 00:09:23,570
Or if you don't want to repeat this, what you can do is just include parentheses here.

147
00:09:24,580 --> 00:09:31,510
I like to do this to organize, so now I know that inside here I'm going to have the exact value.

148
00:09:32,580 --> 00:09:34,320
That's inside that element.

149
00:09:34,560 --> 00:09:37,700
And then we can just do a replace method.

150
00:09:39,310 --> 00:09:42,520
And then we are going to replace the Age CTP as.

151
00:09:44,320 --> 00:09:46,540
Colin Ford slashed Ford's slash.

152
00:09:46,840 --> 00:09:49,710
We are going to replace it with an empty string.

153
00:09:50,960 --> 00:09:54,170
So now we get the you are out for.

154
00:09:57,720 --> 00:10:02,190
And send the content of this string that we just formed.

155
00:10:02,430 --> 00:10:03,930
Let's see if this is right.

156
00:10:08,720 --> 00:10:14,330
So now we can see that we successfully removed the HTP ask from the you are out.

157
00:10:14,630 --> 00:10:15,620
So that was it.

158
00:10:16,130 --> 00:10:21,590
I hope you like this exercise and that you were able to do it without any problem.

159
00:10:21,680 --> 00:10:26,390
So in the next we do, we are going to start diving deeper into JavaScript.

160
00:10:26,690 --> 00:10:27,460
I'll see you then.
