1
00:00:00,180 --> 00:00:06,720
This is going to be a quick lesson on great filter method, so the ray filter method creates a new array

2
00:00:06,720 --> 00:00:11,620
with all elements that pass the test implemented by the provided function.

3
00:00:11,880 --> 00:00:15,630
So we saw with find we could only get one value being returned back.

4
00:00:15,810 --> 00:00:22,260
And in this case with Filter, this gives us an option to construct a brand new array with the results.

5
00:00:22,440 --> 00:00:23,730
So we run this.

6
00:00:23,970 --> 00:00:31,170
We are looking for words with a length that is greater than six and it's returning back a brand new

7
00:00:31,170 --> 00:00:37,220
array as result with those new word and those values contained.

8
00:00:37,410 --> 00:00:44,220
So the objective challenge for this lesson is to create a new array using that existing array or one

9
00:00:44,220 --> 00:00:50,940
that you create with numbers that are greater than 75 output into the console once you've returned back

10
00:00:50,940 --> 00:00:51,810
those results.

11
00:00:52,350 --> 00:00:53,370
So pause the video.

12
00:00:53,370 --> 00:00:55,140
I'll say the solution coming up.

13
00:00:55,150 --> 00:01:00,270
So within the coding, we're going to use one of the rays that we had earlier and creating a variable

14
00:01:00,270 --> 00:01:01,800
called result.

15
00:01:02,010 --> 00:01:07,290
We want to filter through the Mihiri two, because this is the one that's got all of the numbers that

16
00:01:07,290 --> 00:01:10,230
are contained within it, writing up the function.

17
00:01:10,230 --> 00:01:14,220
And we can just have no value there as the argument.

18
00:01:14,550 --> 00:01:17,700
And then again, we can consider log out the number.

19
00:01:17,850 --> 00:01:23,130
And the interesting thing one here is that we're actually going to go through all of them.

20
00:01:23,130 --> 00:01:27,550
So it's not going to stop, as the find did when we actually found that value.

21
00:01:27,870 --> 00:01:33,200
So take a look through and we'll return back all of the ones that are larger than seventy five.

22
00:01:33,210 --> 00:01:36,900
And then afterwards, we'll take a look at what's contained within result.

23
00:01:36,900 --> 00:01:42,570
And I want to add in a few more so that we've got some more numbers that are large and this should actually

24
00:01:42,570 --> 00:01:43,290
be numb.

25
00:01:43,440 --> 00:01:49,680
So when we refresh, you can see it goes through all of the values in the array and then it constructs

26
00:01:49,680 --> 00:01:54,710
that Nuri called result with only the values that met the criteria.

27
00:01:54,720 --> 00:02:00,480
So the same that's fine, but gives us the ability to construct a brand new array that matches that

28
00:02:00,480 --> 00:02:02,360
criteria to try to.
