1 00:00:00,950 --> 00:00:01,820 Welcome back, guys. 2 00:00:01,850 --> 00:00:06,410 Welcome to another lecture here, are we going to continue working with operators, but is it going 3 00:00:06,410 --> 00:00:07,890 to be something very interesting? 4 00:00:07,910 --> 00:00:14,440 Now we're going to talk about Operator Precedent's and I'm going to create Muifa. 5 00:00:14,630 --> 00:00:16,540 It's going to go see Dense. 6 00:00:16,700 --> 00:00:18,440 Not just now. 7 00:00:19,670 --> 00:00:26,960 I'm going to put a link in the description actually for you guys so you can go there and get the resource 8 00:00:26,960 --> 00:00:28,100 that I'm going to show to you. 9 00:00:30,500 --> 00:00:32,330 But before that, let's right. 10 00:00:32,600 --> 00:00:35,090 Let's create another file called Proceedings. 11 00:00:35,360 --> 00:00:39,700 And yeah, let's create another HTML file. 12 00:00:39,710 --> 00:00:43,570 So I'm going to copy this from Control C, Control V, and I'm going to call Pressie. 13 00:00:43,580 --> 00:00:46,190 That's very good. 14 00:00:46,190 --> 00:00:49,870 So the HTML is not going to have all these. 15 00:00:50,420 --> 00:00:50,810 All right. 16 00:00:50,990 --> 00:00:59,210 But it's going to have what, Gristedes JSA and it's going to give me double JS now. 17 00:00:59,210 --> 00:00:59,960 It's all good. 18 00:00:59,960 --> 00:01:01,130 I'm just going to close this one. 19 00:01:01,130 --> 00:01:03,040 I need these two only. 20 00:01:03,440 --> 00:01:05,870 So and here I'm going to see. 21 00:01:08,360 --> 00:01:09,290 Operators. 22 00:01:13,980 --> 00:01:16,880 And I'm going to copy this one and I'm going to paste in here. 23 00:01:17,170 --> 00:01:17,690 Very good. 24 00:01:17,950 --> 00:01:23,440 Now, in order for this to work, slash precedent's. 25 00:01:26,290 --> 00:01:27,830 That HDMI, right? 26 00:01:28,270 --> 00:01:28,990 So here it is. 27 00:01:29,420 --> 00:01:34,630 Now, this is the table that I'm talking about, but we're going to just go back here first. 28 00:01:34,650 --> 00:01:41,140 What I want to do in the proceedings and I'm just going to see the wire, I'm going to create a variable 29 00:01:41,140 --> 00:01:48,820 called current is very good in that current year will be 20-20 for me, for you can be different here 30 00:01:49,030 --> 00:01:49,630 now 31 00:01:52,450 --> 00:02:00,240 for date of birth for Rick is going to be nineteen eighty seven right here. 32 00:02:00,280 --> 00:02:06,510 I want to check if is were in here. 33 00:02:06,520 --> 00:02:09,970 We want to check if it's teenager. 34 00:02:10,960 --> 00:02:12,100 So teenager. 35 00:02:14,910 --> 00:02:20,140 Like Spirit, 16 years and a teenager, I think is between 13 and 19 years, right. 36 00:02:20,400 --> 00:02:28,080 So we're going to we want to check if it's a teenager, if some boys, for example, me, is a teenager. 37 00:02:28,080 --> 00:02:34,920 Now, I know that's a little bit confusing, but what we're going to do, we've got to create oi check. 38 00:02:36,490 --> 00:02:38,320 Status or age? 39 00:02:38,560 --> 00:02:40,420 And we're going to see Carinthia. 40 00:02:42,300 --> 00:02:52,560 Minus date of birth of Rick, and I want to check if this is greater or equal to full age to each teenager. 41 00:02:54,540 --> 00:02:56,350 Now, what will do this? 42 00:02:56,370 --> 00:03:00,980 I'm just going to look at it and I will say check the status. 43 00:03:01,590 --> 00:03:09,450 Now, when we talk about operators proceedings, we just want to see which of these operators consider 44 00:03:09,450 --> 00:03:14,520 this as operator, these as separate operator and even people signees. 45 00:03:14,520 --> 00:03:18,870 Operator, know what you think will be this one. 46 00:03:18,900 --> 00:03:20,460 So it's true. 47 00:03:20,490 --> 00:03:21,420 It returns. 48 00:03:21,420 --> 00:03:21,880 True. 49 00:03:22,230 --> 00:03:24,490 OK, so why is that? 50 00:03:25,680 --> 00:03:35,190 So basically what we want to do here is logically we want this year, the current year 2020 and to be 51 00:03:36,090 --> 00:03:42,750 minus this year, that the year that I'm born and after that to check if this is greater than a teenager 52 00:03:42,960 --> 00:03:44,200 to return me a result. 53 00:03:44,460 --> 00:03:46,680 So as you saw, it's going to return. 54 00:03:46,680 --> 00:03:47,190 True. 55 00:03:47,430 --> 00:03:50,730 Why this is happening is because 2020. 56 00:03:51,040 --> 00:03:58,760 So they have but it's 1987 and here is greater than 16. 57 00:03:58,760 --> 00:03:59,130 Right. 58 00:03:59,820 --> 00:04:10,620 And that is why 2020 minus this one will give you 33, which is so these two will give you 33, which 59 00:04:10,620 --> 00:04:12,590 is greater than teenager. 60 00:04:12,690 --> 00:04:15,780 That's why it is going to give you that result. 61 00:04:16,020 --> 00:04:23,370 So this is the age maybe is not a good example, but I want you to show you that there is an operator 62 00:04:23,370 --> 00:04:24,010 precedent. 63 00:04:24,060 --> 00:04:27,170 So first, this one is not executed first. 64 00:04:27,330 --> 00:04:28,950 These two are executed. 65 00:04:29,340 --> 00:04:31,570 Then this is compared to this one. 66 00:04:31,710 --> 00:04:33,030 So I'm saying this. 67 00:04:33,480 --> 00:04:41,540 If you go back to this table, so here is a Poseidon's in the following table is order from the highest. 68 00:04:41,760 --> 00:04:46,560 I mean, this has the highest precedence and these are individual operators. 69 00:04:46,570 --> 00:04:51,840 So if you put them in the brackets, for example, if you want this to go first, you're going to put 70 00:04:51,840 --> 00:04:54,360 them in brackets and that's how it's going to work. 71 00:04:54,660 --> 00:05:00,570 But now that's what we have here, is we have it's greater or equal to in minus. 72 00:05:00,840 --> 00:05:02,460 Let's check where the minus is. 73 00:05:03,600 --> 00:05:04,790 You need to go like this. 74 00:05:04,980 --> 00:05:09,360 So we're going to here it is unary negation, that's how they call it. 75 00:05:09,690 --> 00:05:11,150 And it's 17. 76 00:05:11,880 --> 00:05:14,160 And where is a greater or equal to here? 77 00:05:14,160 --> 00:05:15,980 It is greater than or equal. 78 00:05:16,140 --> 00:05:17,470 So it's on 12. 79 00:05:17,910 --> 00:05:20,560 So 17 is higher than 12. 80 00:05:20,790 --> 00:05:22,830 That's why we did. 81 00:05:23,700 --> 00:05:23,990 Yep. 82 00:05:24,000 --> 00:05:24,420 Here it is. 83 00:05:24,630 --> 00:05:28,440 So these all these all have a precedence or 17. 84 00:05:28,450 --> 00:05:29,220 Don't be confused. 85 00:05:29,460 --> 00:05:37,530 So that's why minus unary negation is more powerful than this. 86 00:05:38,610 --> 00:05:40,650 Greater than or less than. 87 00:05:40,660 --> 00:05:40,960 Right. 88 00:05:41,070 --> 00:05:44,460 So even if we use less than the first will go for the minus. 89 00:05:44,700 --> 00:05:46,940 That is why you need to check this table. 90 00:05:46,950 --> 00:05:49,710 And now the last part is this equation. 91 00:05:49,710 --> 00:05:51,390 I mean, assignment. 92 00:05:51,660 --> 00:05:54,350 So that's why you check status. 93 00:05:54,570 --> 00:05:59,760 It's giving us true or false because we are checking the status and we're checking the status. 94 00:05:59,880 --> 00:06:04,110 And actually that is getting the value what is being calculated here. 95 00:06:04,830 --> 00:06:06,040 So I hope I am. 96 00:06:08,010 --> 00:06:10,800 You understand what I'm trying to say now. 97 00:06:11,010 --> 00:06:18,300 Be careful, because if you do some operation, mathematical operation, wherever it is, make sure 98 00:06:18,300 --> 00:06:23,100 that you are choosing things wisely because this is stronger than this. 99 00:06:23,100 --> 00:06:25,800 And it will this part will be executed before this part. 100 00:06:25,960 --> 00:06:26,320 Right. 101 00:06:26,580 --> 00:06:32,370 So maybe some of you think, OK, this part will go first and after that it will compare it to the current 102 00:06:32,370 --> 00:06:32,550 year. 103 00:06:32,940 --> 00:06:33,510 It will be. 104 00:06:34,500 --> 00:06:36,290 Yeah, it will be go minus with the company. 105 00:06:36,310 --> 00:06:37,390 But that's not the case. 106 00:06:40,100 --> 00:06:42,520 OK, that was a crazy example. 107 00:06:42,540 --> 00:06:43,980 Now I'm just going to comment this one. 108 00:06:44,190 --> 00:06:46,850 We're going to do another example. 109 00:06:46,860 --> 00:06:49,590 For example, I'm going to say more first. 110 00:06:49,590 --> 00:06:52,800 No second number 111 00:06:55,650 --> 00:06:56,340 if I can type of. 112 00:06:56,340 --> 00:06:56,650 Right. 113 00:06:56,790 --> 00:06:57,630 Third number. 114 00:06:59,640 --> 00:07:00,450 And that's it. 115 00:07:02,190 --> 00:07:04,210 And yes, this is not correct. 116 00:07:04,590 --> 00:07:08,130 Now I'm going to initialize all the clear values for them here. 117 00:07:08,370 --> 00:07:13,440 First number, let's say, OK, I'm going to give it the 15 second number. 118 00:07:13,470 --> 00:07:15,590 And it's good to have the space. 119 00:07:15,600 --> 00:07:19,410 It's more it's not going to change anything, but it's good to have space. 120 00:07:19,510 --> 00:07:22,770 Second number and third number. 121 00:07:23,280 --> 00:07:27,630 Now, here, I will say five in here I will see twenty five. 122 00:07:27,780 --> 00:07:28,170 Right. 123 00:07:29,010 --> 00:07:32,810 Maybe I should go with 20 because I have five, five, five everywhere. 124 00:07:32,850 --> 00:07:38,350 Now I have three numbers that have initial values inside. 125 00:07:38,760 --> 00:07:41,580 Now what I want to do is I'm going to show you. 126 00:07:42,120 --> 00:07:42,600 That. 127 00:07:44,650 --> 00:07:52,420 We can use this one individual operators like this, so what I'm what I can do is I can say, OK. 128 00:07:53,630 --> 00:08:00,070 For let's put a result here, here, I'm going to say a result. 129 00:08:00,680 --> 00:08:04,520 The result is not actually holding any value, but it will hold in a minute. 130 00:08:05,000 --> 00:08:11,930 Now, I just want third number to go minus first number. 131 00:08:13,220 --> 00:08:16,340 And after that, I just want to do the least. 132 00:08:16,550 --> 00:08:21,130 So third number is 20, minus five minus this. 133 00:08:21,170 --> 00:08:24,680 The first number is going to give us a five year after that. 134 00:08:24,680 --> 00:08:28,130 I want to delete by this second number. 135 00:08:28,940 --> 00:08:31,500 Now, what do you think the result will be? 136 00:08:32,120 --> 00:08:36,630 So let's alert and check the result. 137 00:08:36,920 --> 00:08:40,090 So I'm just going to alert this result instead of a log. 138 00:08:40,100 --> 00:08:41,810 But if you want, you can do calls a lot. 139 00:08:42,920 --> 00:08:46,160 And it is why why it's won what you think is one. 140 00:08:46,490 --> 00:08:52,730 Now, first, everything that is in this bracket, there is a precedence of 21 in here. 141 00:08:52,730 --> 00:08:59,730 Inside there is a negation, how they call it negation in their negation. 142 00:08:59,960 --> 00:09:01,120 So this will happen. 143 00:09:01,130 --> 00:09:05,030 So 20 minus 15 will will be five. 144 00:09:05,240 --> 00:09:12,410 And after that, these four deletion where it is, I'm just going to need to find out if it is the vision 145 00:09:12,410 --> 00:09:16,280 is on the number of 15 and before was minus. 146 00:09:16,820 --> 00:09:17,270 Right. 147 00:09:18,380 --> 00:09:23,950 And everything is going under a like like that logic from this table, from this president. 148 00:09:24,200 --> 00:09:31,820 So that is why you should look into that residence and everything will happen first in the brackets, 149 00:09:32,240 --> 00:09:35,540 regardless of what is here, that will be second. 150 00:09:35,570 --> 00:09:36,620 So even if we do 151 00:09:39,350 --> 00:09:46,490 even if we do multiplication because multiplication and division, let's see, um, here it is. 152 00:09:46,940 --> 00:09:50,150 Multiplication is from left to right. 153 00:09:50,160 --> 00:09:53,270 Doesn't matter how you multiply in division, they're in the same place. 154 00:09:53,450 --> 00:09:59,960 So it actually will be the result should be twenty minus 15 will be five times five. 155 00:09:59,960 --> 00:10:04,070 Should I should get the result of twenty five. 156 00:10:04,470 --> 00:10:07,350 It is the result is twenty five. 157 00:10:07,490 --> 00:10:11,600 So I hope you get the logic of Operator Precedent's. 158 00:10:15,370 --> 00:10:23,440 Let's do one more example where we are going to have a multiple variables and so I'm going to have first, 159 00:10:23,440 --> 00:10:28,450 second, third, and I'm going to add fourth here and the fourth. 160 00:10:30,940 --> 00:10:38,980 Will be how much like maybe six doesn't matter, we will see at the end now here I'm just going to common 161 00:10:38,980 --> 00:10:47,140 these four actually we can common all of these and do it from scratch because I don't want to see any 162 00:10:47,650 --> 00:10:49,200 alert box from previous. 163 00:10:49,540 --> 00:10:54,610 Now, I just want it resolved to do something like this. 164 00:10:56,710 --> 00:11:01,870 I would like to do again in brackets. 165 00:11:01,870 --> 00:11:12,040 I would want to have a first number plus a third number, and we should have five here because everything 166 00:11:12,040 --> 00:11:14,710 is like around it with fives. 167 00:11:15,100 --> 00:11:18,040 So we have first number plus third number. 168 00:11:18,220 --> 00:11:24,370 And after that we can have multiplication times for number. 169 00:11:27,630 --> 00:11:28,780 Thumbs for no. 170 00:11:29,130 --> 00:11:33,330 If we're going to minus again, this second number. 171 00:11:34,920 --> 00:11:41,320 OK, so I think we use everyone first, second, third and fourth. 172 00:11:41,580 --> 00:11:47,240 Now, I'm just going to go to alert and let's check out the result. 173 00:11:47,250 --> 00:11:50,990 And I'm going to pause the video if you want, in order. 174 00:11:51,030 --> 00:11:53,700 I'm just going to close here, just going to refresh. 175 00:11:53,850 --> 00:11:56,100 So the number is 170. 176 00:11:56,430 --> 00:12:02,370 So I'm going to pause the video and actually will leave you guys like five, four or not. 177 00:12:02,390 --> 00:12:06,870 But we'll give you one minute to think about how I get this number. 178 00:12:08,430 --> 00:12:10,330 OK, I hope you get this one right. 179 00:12:10,350 --> 00:12:14,760 So because I've done it in that minute, I've just put it here. 180 00:12:15,270 --> 00:12:20,690 The steps show these is when you put I didn't put resultantly. 181 00:12:20,700 --> 00:12:25,030 So 15 is the first number, 20 is the third number times five, that minus five. 182 00:12:25,170 --> 00:12:29,100 So actually we have second number and thought number to be five doesn't matter. 183 00:12:29,310 --> 00:12:39,030 So the first step is everything to do in these areas, you know, or grouping operator. 184 00:12:39,040 --> 00:12:43,730 So that is taking a first presidents and that's why it's coming out the thirty five. 185 00:12:43,920 --> 00:12:50,680 So the second one is which one is it stronger at multiplication or minus. 186 00:12:50,880 --> 00:13:02,070 So you see here that if you go down you will see that multiplication will take this one as first. 187 00:13:06,230 --> 00:13:10,910 Sorry, guys, I just got a little bit confused, so it's not this one that we're just looking, it's 188 00:13:10,910 --> 00:13:12,390 about the substraction. 189 00:13:12,410 --> 00:13:17,540 So it's a fraction is a number 14, and that's why the multiplication is on level 15. 190 00:13:17,720 --> 00:13:21,260 So forget about everything that I've told you about before. 191 00:13:21,470 --> 00:13:26,300 So you should look, when it's come to mind, is this one substraction? 192 00:13:26,390 --> 00:13:26,800 Right. 193 00:13:27,350 --> 00:13:33,810 I just bought my video because I realize how come that I'm looking at this one negation here, you know, 194 00:13:33,890 --> 00:13:34,580 negation. 195 00:13:34,880 --> 00:13:39,770 And because I was I was I looked at that one and I was thinking, OK, that that is the minus, but 196 00:13:39,770 --> 00:13:40,710 that is not the case. 197 00:13:40,730 --> 00:13:45,890 So 17, it's not for that substraction it's 14. 198 00:13:45,890 --> 00:13:49,790 Actually, that is why the result will be like this. 199 00:13:51,200 --> 00:13:56,750 The first this will happen then because the multiplication is stronger than the minus. 200 00:13:56,960 --> 00:14:03,680 It will happen that one thirty five times five and that is one hundred seventy five. 201 00:14:03,980 --> 00:14:08,630 And after that we have the third step is this one hundred seventy five. 202 00:14:08,840 --> 00:14:14,900 So the result, that's why the result that we have in here, we just passing there, it's 175, it goes 203 00:14:14,900 --> 00:14:15,380 here. 204 00:14:15,710 --> 00:14:20,510 That is the third and final step and that is why we have one hundred and seventy. 205 00:14:20,570 --> 00:14:25,730 Now I hope you understand and this is about Operator Precedent's. 206 00:14:25,940 --> 00:14:30,110 It's sometimes a little bit complicated to explain, but it's not that much. 207 00:14:30,530 --> 00:14:36,950 Make sure you understand this table and don't just rush like me and think that this is the minus right 208 00:14:37,280 --> 00:14:37,730 now. 209 00:14:37,730 --> 00:14:46,220 The the highest, no more stronger precedent's, the lowest number like this one where this assignment 210 00:14:47,040 --> 00:14:52,400 actually the result that is this part from left, from right to left. 211 00:14:52,670 --> 00:14:54,850 So we're going to assign it that. 212 00:14:55,130 --> 00:15:01,910 That's why that assignment happens last, because we are precedent's number three. 213 00:15:02,720 --> 00:15:04,460 That is pretty much it for this lecture. 214 00:15:04,610 --> 00:15:05,780 I hope you enjoy it. 215 00:15:05,990 --> 00:15:13,460 Now, you know how these operate precedent's is working and you just practice it, find some other examples 216 00:15:13,460 --> 00:15:17,680 here and just compare it divided and stuff like that. 217 00:15:17,780 --> 00:15:18,440 Thank you very much. 218 00:15:18,560 --> 00:15:19,430 I hope you enjoyed it. 219 00:15:19,430 --> 00:15:21,050 And I will see you in the next one.