Welcome back, ladies and gentlemen.
Today, we're going to start doing some new features of iOS seven, or that is ECMAScript 2016.
So we are moving forward and you should be very happy because of this to you.
You have done a very huge progress.
Now, we've started with iOS five features.
Then we move to year six.
Now we are iOS seven.
So.
Don't get confused because S7 seven will not have that many features like Essex, Essex was major,
2015 was a major JavaScript release.
A lot of features were introduced, but not in year seven.
OK, now is seven will be super simple for you guys to to understand because this is only small incremental
update in what ECMAScript is doing.
It's not going to do something major like 2015.
It will start releasing smaller and smaller updates, smaller things, smaller features.
So, yeah, but those features are very important.
And I'm not going to say that in future there might something happen like it happened with the 2015
or S6.
So that can happen the same thing in future.
But for now the releases will be smaller.
So in year seven we have to the first is includes.
Method in these two methods that I'm going to see, we can use it on arrays and on strings, right.
And the other one is exponential operator.
Very good.
Now, let's start with includes honourees.
Honourees, now let's create an array consed cars, you can do that if you want.
Now we're going to put inside a couple of names, BMV it's not BMW, but always BMW.
That's a German name.
So Ford.
So now we need to respect a couple of things.
This is out of this course, so some names that we using in our English, they're not how they should
be pronounced.
So every time I see some term that it's not coming from English, it's it's not coming from from USA,
then I just try to find the roots in the Roots for these are German and I always try to call the name
of the German car manufacturer, as they call it, in Germany.
So this is BMV, OK, because w it's a very in English.
In German for now we have already.
It's not Audy, it's Audy, then we have Bauscher.
A little bit of history right today.
And this is not Mercedes's or Merck, it's Merita, this.
Very good now.
So how we can do includes all the method on the and what does this includes he's doing OK, so let's
Khandala a couple of things here.
Now what I'm going to do, I'm going to say cardstock so I can use straight includes here on cars and
I can say OK, does it include the word.
Shaviro, if I pronounce it or I mean, if I type of good, so make sure that you select your five,
link it here in the index.
Now.
Let's see if this is going to work.
Or not.
So it gives me back false, why is this wow, that is actually true.
I mean, this is false and that it should be it should be false because it is true that in our area
we don't have anywhere at Chevrolet.
That's what he's doing.
OK, now, next thing, console that lock.
We are going to try to see if the cars includes, for example, Ori.
And he should return true because it is true that we have order here.
There you go.
We have to now just going to copy one more.
And I want you to be aware of this, so you fight that for like this, so I'm here is with capital letters
and here is a small left or right.
So there is a difference there.
They should be false.
And it's a case sensitive.
Right.
So make sure that you understand, even if we type it like this, f o r d still will return.
False.
OK, there you go.
So now you know that what this includes metal does.
It will certiorari.
It will find OK.
Yeah it is.
Including the audio here.
So yeah, this is super useful.
For example, you have a long list, you have long array there and you want to see if this array includes
something.
And if it does, you can do the rest of your logic.
Right.
This is super cool and nice.
Instead of instead of looping through each and every query in trying if the element, the current element
is equal to Audy.
Right.
This is very nice.
This was just an example now.
Let use includes method on.
Strings, so I'm going to say consed full name here and I'm going to say Jack Reacher, right, nice.
So cancel that long full name, not function fullname.
That includes, uh.
And I'm going to say just one letter here.
I'm not going to say so.
Yeah, that should be back to us.
True.
But let's do something here, Consolo long before I save it.
So I can space them a little bit out so I will know which one is coming.
OK, so that is giving us true nice.
So let's see if I can do capital letters.
E.
That's false.
So this is false, this is true.
Nice.
So let's see if I can do a more than one letter.
Right.
So if I if these full names includes AC, that's from Jack from here.
Right.
And that should be true.
There you go.
So you can also search for a whole swear word.
So.
Jack, they should go through.
What about this?
So what will happen, what you doing?
Because I have a space there, right?
So what will happen if we search for a space to delete this one, hit space on your keyboard?
Save it.
There you go.
That is true as well.
So that is about includes method.
And now we need to do the exponential operator.
Now, what is this and how it will be useful for us?
OK, so I'm going to create a function called calculate squares.
If I can type it right and it will take one parameter, why?
Because when we have a square.
And should be like this.
So if it takes one parameter and it multiplies by itself, so the power of two, right, so X.
X, then we can do this, sorry.
Yeah, and to this looks here, weird when I just type it Tabit on my on my Windows computer, it was
a little bit different representation that this was a little bit up there.
Doesn't matter.
Now, let's see if this is going to work.
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
four.
So power of two.
When I have power of two, it will be four times four.
And let's consider the result.
See what happens.
There you go.
We have 16 now, if I do six, actually, we don't need to say here.
Let thirty six, so I rewrite the value of this one, that's why it's not giving me an error, but you
can just you can just comment out this part.
OK, now that is pretty much the exponential operator.
So it gives us option to put the to do create functions like this.
And we can also calculate Kupe.
Let's do this cost Calc Cube.
And again, it will take one parameter and this will be a narrow function again, but on three.
So any time now I say resolve equal Calc Cube, let's put it three there.
I should have results on the twenty seven.
I would say nine, but the actually twenty seven.
Right.
If I have.
Let's say five, I should have one hundred and twenty five nice, so now you know how to use the exponential
operator, you know how to use the includes method on the arrays or strings.
And there you go.
You have the the features that were introduced in years seven.
OK, so thank you very much.
And I will see you in the next one.