1
00:00:02,220 --> 00:00:07,980
Let's talk about another method which is called the include.

2
00:00:08,640 --> 00:00:12,690
The include method is also crucial or is also important.

3
00:00:12,690 --> 00:00:16,379
So let me comment here and.

4
00:00:17,840 --> 00:00:21,950
As includes as that.

5
00:00:22,910 --> 00:00:23,790
Perfect.

6
00:00:23,810 --> 00:00:25,190
So what does it include?

7
00:00:25,190 --> 00:00:25,670
Method.

8
00:00:25,700 --> 00:00:32,150
They include method determines whether a string contains in a specified string.

9
00:00:32,270 --> 00:00:34,870
If it does, it returns true.

10
00:00:34,880 --> 00:00:37,040
Otherwise it returns false.

11
00:00:37,400 --> 00:00:39,230
So it takes two arguments.

12
00:00:39,230 --> 00:00:48,590
One is a text to search, and then two is a starting point, but by default is zero.

13
00:00:48,800 --> 00:00:56,960
And again, the enclosed methods is also case sensitive, meaning that if you pass in uppercase and

14
00:00:56,960 --> 00:01:01,000
you are searching for lowercase, it's always going to return false.

15
00:01:01,010 --> 00:01:02,930
So let's see in action.

16
00:01:03,290 --> 00:01:06,500
Let me declare a variable called.

17
00:01:07,830 --> 00:01:11,070
Strength for SDR is equal to.

18
00:01:12,100 --> 00:01:16,180
Are you a developer?

19
00:01:17,550 --> 00:01:22,820
Question I think I have declared the SDR, so let me comment out again.

20
00:01:22,840 --> 00:01:23,770
Yes, this one.

21
00:01:23,770 --> 00:01:25,930
So now I'll be free to use this variable.

22
00:01:26,410 --> 00:01:33,190
So for this one, let's check if you is in this particular string.

23
00:01:33,400 --> 00:01:39,790
So include is also very crucial or important for searching for this string.

24
00:01:40,240 --> 00:01:48,610
I want to check that if there is a letter U inside this particular string and it's possible to use the

25
00:01:48,610 --> 00:01:51,420
string dot includes method.

26
00:01:51,430 --> 00:01:53,830
I want to search for you.

27
00:01:54,830 --> 00:01:59,370
That's you insight or appears in this string.

28
00:01:59,390 --> 00:02:00,200
Yes.

29
00:02:00,200 --> 00:02:02,630
Because there is you inside here.

30
00:02:02,660 --> 00:02:04,990
Again, it's also case sensitive.

31
00:02:05,000 --> 00:02:07,100
So I pass in here as this.

32
00:02:07,490 --> 00:02:11,030
There is no letter that start with uppercase y.

33
00:02:11,180 --> 00:02:15,210
So let's assign the result of this one into a variable.

34
00:02:15,230 --> 00:02:18,140
Core result is equal to this.

35
00:02:18,350 --> 00:02:28,060
So if I console.log the result I have force because I told you includes is also case sensitive.

36
00:02:28,070 --> 00:02:33,820
So to make sure that you are you are saying what are passing in is always trying.

37
00:02:33,830 --> 00:02:39,380
We can turn this one to, let's say, uppercase or lowercase.

38
00:02:39,590 --> 00:02:40,920
For now, let's maintain it.

39
00:02:40,940 --> 00:02:44,510
So the key point here is that it is case sensitive.

40
00:02:44,540 --> 00:02:45,890
That's why we got false.

41
00:02:45,980 --> 00:02:53,000
The next thing is, bear in mind is that these include also take in second argument.

42
00:02:53,900 --> 00:02:58,370
If you provide zero, it means that you want to search the entire string.

43
00:02:58,490 --> 00:03:06,110
So by default is zero because we have zero here and then 1 to 3, right.

44
00:03:06,110 --> 00:03:10,190
Because y spacing is also being counted as a string.

45
00:03:10,580 --> 00:03:11,120
Okay.

46
00:03:11,120 --> 00:03:15,590
So let's say that I want to start searching from, let's say de here.

47
00:03:15,740 --> 00:03:22,550
So let's say zero one, two, three, four, five, six, seven, eight.

48
00:03:22,600 --> 00:03:23,240
Okay.

49
00:03:23,270 --> 00:03:28,280
So if I add it here, is this function going to return true or false?

50
00:03:28,310 --> 00:03:29,770
Going to be false, yes.

51
00:03:29,780 --> 00:03:37,070
You see, because a start from where here and we are searching for we are searching for you, which

52
00:03:37,070 --> 00:03:38,470
is not part of this string.

53
00:03:38,480 --> 00:03:41,920
So by default we normally bring zero or nothing at all.

54
00:03:41,930 --> 00:03:44,720
And indeed I got true.

55
00:03:45,080 --> 00:03:47,390
That is the include for you.

56
00:03:47,570 --> 00:03:53,450
Well, in the next video let's see our first coding challenge under include.

