1 00:00:00,720 --> 00:00:01,890 Welcome back, ladies and gentlemen. 2 00:00:01,920 --> 00:00:09,430 Today, we're going to start doing some new features of iOS seven, or that is ECMAScript 2016. 3 00:00:09,870 --> 00:00:14,580 So we are moving forward and you should be very happy because of this to you. 4 00:00:14,940 --> 00:00:17,230 You have done a very huge progress. 5 00:00:17,650 --> 00:00:19,820 Now, we've started with iOS five features. 6 00:00:19,830 --> 00:00:21,210 Then we move to year six. 7 00:00:21,460 --> 00:00:23,130 Now we are iOS seven. 8 00:00:23,400 --> 00:00:23,910 So. 9 00:00:25,370 --> 00:00:31,520 Don't get confused because S7 seven will not have that many features like Essex, Essex was major, 10 00:00:31,520 --> 00:00:34,840 2015 was a major JavaScript release. 11 00:00:35,240 --> 00:00:38,300 A lot of features were introduced, but not in year seven. 12 00:00:38,480 --> 00:00:47,990 OK, now is seven will be super simple for you guys to to understand because this is only small incremental 13 00:00:47,990 --> 00:00:50,930 update in what ECMAScript is doing. 14 00:00:51,540 --> 00:00:53,990 It's not going to do something major like 2015. 15 00:00:54,200 --> 00:00:59,320 It will start releasing smaller and smaller updates, smaller things, smaller features. 16 00:00:59,480 --> 00:01:03,560 So, yeah, but those features are very important. 17 00:01:03,680 --> 00:01:10,130 And I'm not going to say that in future there might something happen like it happened with the 2015 18 00:01:10,130 --> 00:01:11,270 or S6. 19 00:01:11,540 --> 00:01:13,670 So that can happen the same thing in future. 20 00:01:13,670 --> 00:01:16,720 But for now the releases will be smaller. 21 00:01:16,730 --> 00:01:20,900 So in year seven we have to the first is includes. 22 00:01:21,910 --> 00:01:28,910 Method in these two methods that I'm going to see, we can use it on arrays and on strings, right. 23 00:01:29,470 --> 00:01:33,920 And the other one is exponential operator. 24 00:01:35,350 --> 00:01:36,010 Very good. 25 00:01:36,340 --> 00:01:40,330 Now, let's start with includes honourees. 26 00:01:43,480 --> 00:01:51,370 Honourees, now let's create an array consed cars, you can do that if you want. 27 00:01:51,670 --> 00:01:59,400 Now we're going to put inside a couple of names, BMV it's not BMW, but always BMW. 28 00:02:00,010 --> 00:02:01,080 That's a German name. 29 00:02:01,750 --> 00:02:02,920 So Ford. 30 00:02:05,020 --> 00:02:09,500 So now we need to respect a couple of things. 31 00:02:09,850 --> 00:02:16,930 This is out of this course, so some names that we using in our English, they're not how they should 32 00:02:16,930 --> 00:02:17,640 be pronounced. 33 00:02:17,860 --> 00:02:26,380 So every time I see some term that it's not coming from English, it's it's not coming from from USA, 34 00:02:26,710 --> 00:02:33,850 then I just try to find the roots in the Roots for these are German and I always try to call the name 35 00:02:33,850 --> 00:02:37,050 of the German car manufacturer, as they call it, in Germany. 36 00:02:37,060 --> 00:02:41,920 So this is BMV, OK, because w it's a very in English. 37 00:02:42,070 --> 00:02:45,490 In German for now we have already. 38 00:02:46,930 --> 00:02:51,100 It's not Audy, it's Audy, then we have Bauscher. 39 00:02:54,340 --> 00:02:58,300 A little bit of history right today. 40 00:02:59,400 --> 00:03:03,660 And this is not Mercedes's or Merck, it's Merita, this. 41 00:03:06,130 --> 00:03:08,230 Very good now. 42 00:03:10,170 --> 00:03:17,460 So how we can do includes all the method on the and what does this includes he's doing OK, so let's 43 00:03:17,460 --> 00:03:18,850 Khandala a couple of things here. 44 00:03:19,300 --> 00:03:25,350 Now what I'm going to do, I'm going to say cardstock so I can use straight includes here on cars and 45 00:03:25,350 --> 00:03:29,130 I can say OK, does it include the word. 46 00:03:30,670 --> 00:03:39,850 Shaviro, if I pronounce it or I mean, if I type of good, so make sure that you select your five, 47 00:03:39,850 --> 00:03:41,060 link it here in the index. 48 00:03:41,440 --> 00:03:41,980 Now. 49 00:03:43,770 --> 00:03:45,110 Let's see if this is going to work. 50 00:03:46,590 --> 00:03:47,160 Or not. 51 00:03:49,890 --> 00:03:55,200 So it gives me back false, why is this wow, that is actually true. 52 00:03:55,650 --> 00:04:01,800 I mean, this is false and that it should be it should be false because it is true that in our area 53 00:04:01,830 --> 00:04:03,340 we don't have anywhere at Chevrolet. 54 00:04:03,720 --> 00:04:04,910 That's what he's doing. 55 00:04:04,920 --> 00:04:08,570 OK, now, next thing, console that lock. 56 00:04:09,210 --> 00:04:15,150 We are going to try to see if the cars includes, for example, Ori. 57 00:04:18,840 --> 00:04:23,730 And he should return true because it is true that we have order here. 58 00:04:25,110 --> 00:04:25,740 There you go. 59 00:04:26,010 --> 00:04:30,030 We have to now just going to copy one more. 60 00:04:31,570 --> 00:04:39,360 And I want you to be aware of this, so you fight that for like this, so I'm here is with capital letters 61 00:04:39,370 --> 00:04:41,560 and here is a small left or right. 62 00:04:42,020 --> 00:04:43,260 So there is a difference there. 63 00:04:43,270 --> 00:04:44,320 They should be false. 64 00:04:44,800 --> 00:04:46,800 And it's a case sensitive. 65 00:04:47,050 --> 00:04:47,370 Right. 66 00:04:47,620 --> 00:04:55,660 So make sure that you understand, even if we type it like this, f o r d still will return. 67 00:04:55,660 --> 00:04:56,140 False. 68 00:04:56,170 --> 00:04:58,130 OK, there you go. 69 00:04:58,150 --> 00:05:01,240 So now you know that what this includes metal does. 70 00:05:01,360 --> 00:05:02,680 It will certiorari. 71 00:05:02,680 --> 00:05:03,910 It will find OK. 72 00:05:03,920 --> 00:05:05,800 Yeah it is. 73 00:05:05,800 --> 00:05:07,760 Including the audio here. 74 00:05:07,780 --> 00:05:09,520 So yeah, this is super useful. 75 00:05:09,520 --> 00:05:16,240 For example, you have a long list, you have long array there and you want to see if this array includes 76 00:05:16,240 --> 00:05:16,930 something. 77 00:05:16,930 --> 00:05:20,770 And if it does, you can do the rest of your logic. 78 00:05:20,770 --> 00:05:21,010 Right. 79 00:05:21,220 --> 00:05:22,660 This is super cool and nice. 80 00:05:22,810 --> 00:05:28,660 Instead of instead of looping through each and every query in trying if the element, the current element 81 00:05:28,660 --> 00:05:31,030 is equal to Audy. 82 00:05:31,030 --> 00:05:31,500 Right. 83 00:05:32,980 --> 00:05:34,300 This is very nice. 84 00:05:37,170 --> 00:05:39,130 This was just an example now. 85 00:05:40,250 --> 00:05:46,610 Let use includes method on. 86 00:05:47,610 --> 00:05:59,070 Strings, so I'm going to say consed full name here and I'm going to say Jack Reacher, right, nice. 87 00:05:59,580 --> 00:06:05,970 So cancel that long full name, not function fullname. 88 00:06:06,360 --> 00:06:09,060 That includes, uh. 89 00:06:10,460 --> 00:06:12,860 And I'm going to say just one letter here. 90 00:06:12,890 --> 00:06:14,510 I'm not going to say so. 91 00:06:14,510 --> 00:06:16,760 Yeah, that should be back to us. 92 00:06:16,760 --> 00:06:17,000 True. 93 00:06:17,000 --> 00:06:20,690 But let's do something here, Consolo long before I save it. 94 00:06:23,040 --> 00:06:27,180 So I can space them a little bit out so I will know which one is coming. 95 00:06:27,210 --> 00:06:29,690 OK, so that is giving us true nice. 96 00:06:29,850 --> 00:06:33,210 So let's see if I can do capital letters. 97 00:06:34,120 --> 00:06:34,470 E. 98 00:06:36,620 --> 00:06:37,430 That's false. 99 00:06:37,460 --> 00:06:40,790 So this is false, this is true. 100 00:06:42,620 --> 00:06:43,100 Nice. 101 00:06:43,220 --> 00:06:48,140 So let's see if I can do a more than one letter. 102 00:06:48,150 --> 00:06:48,440 Right. 103 00:06:48,470 --> 00:06:54,720 So if I if these full names includes AC, that's from Jack from here. 104 00:06:54,720 --> 00:06:54,970 Right. 105 00:06:55,190 --> 00:06:57,380 And that should be true. 106 00:06:57,680 --> 00:06:58,280 There you go. 107 00:07:00,320 --> 00:07:03,530 So you can also search for a whole swear word. 108 00:07:03,680 --> 00:07:03,950 So. 109 00:07:07,830 --> 00:07:10,710 Jack, they should go through. 110 00:07:12,810 --> 00:07:13,680 What about this? 111 00:07:14,220 --> 00:07:15,660 So what will happen, what you doing? 112 00:07:15,840 --> 00:07:17,280 Because I have a space there, right? 113 00:07:19,210 --> 00:07:26,480 So what will happen if we search for a space to delete this one, hit space on your keyboard? 114 00:07:26,770 --> 00:07:27,460 Save it. 115 00:07:28,300 --> 00:07:29,060 There you go. 116 00:07:29,920 --> 00:07:31,710 That is true as well. 117 00:07:33,190 --> 00:07:35,900 So that is about includes method. 118 00:07:36,220 --> 00:07:40,800 And now we need to do the exponential operator. 119 00:07:41,140 --> 00:07:44,890 Now, what is this and how it will be useful for us? 120 00:07:51,380 --> 00:07:55,550 OK, so I'm going to create a function called calculate squares. 121 00:07:56,930 --> 00:08:00,140 If I can type it right and it will take one parameter, why? 122 00:08:00,140 --> 00:08:01,970 Because when we have a square. 123 00:08:03,490 --> 00:08:05,320 And should be like this. 124 00:08:06,630 --> 00:08:13,740 So if it takes one parameter and it multiplies by itself, so the power of two, right, so X. 125 00:08:16,530 --> 00:08:20,010 X, then we can do this, sorry. 126 00:08:22,200 --> 00:08:31,050 Yeah, and to this looks here, weird when I just type it Tabit on my on my Windows computer, it was 127 00:08:31,290 --> 00:08:34,120 a little bit different representation that this was a little bit up there. 128 00:08:34,170 --> 00:08:34,720 Doesn't matter. 129 00:08:35,040 --> 00:08:37,200 Now, let's see if this is going to work. 130 00:08:37,560 --> 00:08:45,450 So I'm going to say let's resolve equal to I'm going to call this function and I'm going to pass number 131 00:08:45,450 --> 00:08:45,860 four. 132 00:08:46,230 --> 00:08:47,640 So power of two. 133 00:08:47,940 --> 00:08:50,400 When I have power of two, it will be four times four. 134 00:08:50,640 --> 00:08:53,010 And let's consider the result. 135 00:08:55,540 --> 00:08:56,330 See what happens. 136 00:08:56,860 --> 00:08:57,320 There you go. 137 00:08:57,340 --> 00:09:05,830 We have 16 now, if I do six, actually, we don't need to say here. 138 00:09:07,160 --> 00:09:13,040 Let thirty six, so I rewrite the value of this one, that's why it's not giving me an error, but you 139 00:09:13,040 --> 00:09:15,560 can just you can just comment out this part. 140 00:09:15,590 --> 00:09:19,360 OK, now that is pretty much the exponential operator. 141 00:09:19,640 --> 00:09:24,530 So it gives us option to put the to do create functions like this. 142 00:09:24,860 --> 00:09:26,900 And we can also calculate Kupe. 143 00:09:27,410 --> 00:09:30,950 Let's do this cost Calc Cube. 144 00:09:33,070 --> 00:09:40,400 And again, it will take one parameter and this will be a narrow function again, but on three. 145 00:09:40,660 --> 00:09:49,480 So any time now I say resolve equal Calc Cube, let's put it three there. 146 00:09:49,820 --> 00:09:52,420 I should have results on the twenty seven. 147 00:09:52,430 --> 00:09:54,370 I would say nine, but the actually twenty seven. 148 00:09:54,580 --> 00:09:54,900 Right. 149 00:09:55,090 --> 00:09:55,870 If I have. 150 00:09:57,450 --> 00:10:04,440 Let's say five, I should have one hundred and twenty five nice, so now you know how to use the exponential 151 00:10:04,440 --> 00:10:08,700 operator, you know how to use the includes method on the arrays or strings. 152 00:10:08,970 --> 00:10:09,780 And there you go. 153 00:10:09,780 --> 00:10:14,890 You have the the features that were introduced in years seven. 154 00:10:15,420 --> 00:10:17,430 OK, so thank you very much. 155 00:10:17,430 --> 00:10:18,780 And I will see you in the next one.