1
00:00:00,560 --> 00:00:01,970
In this video.

2
00:00:02,000 --> 00:00:10,750
Let's talk about string concatenation, meaning how can we combine two or more strings together?

3
00:00:10,760 --> 00:00:13,700
And that's what you call string concatenation.

4
00:00:13,700 --> 00:00:18,530
So let me comment out all these ones for future references.

5
00:00:18,530 --> 00:00:21,020
And now let's begin a new concept.

6
00:00:21,110 --> 00:00:22,580
So we're down here.

7
00:00:22,820 --> 00:00:27,050
Down here, let's comment here and you have this comment that is a new topic.

8
00:00:27,050 --> 00:00:28,790
So string.

9
00:00:31,440 --> 00:00:32,700
Concatenation.

10
00:00:34,510 --> 00:00:39,070
We have couple of ways of combining strings together.

11
00:00:39,100 --> 00:00:43,150
The first one is using the plus operator.

12
00:00:44,390 --> 00:00:47,570
So let's see, how can we combine strains together?

13
00:00:47,600 --> 00:00:56,390
So let's say that I have this two counts and I would need my first string and string one which is equal

14
00:00:56,390 --> 00:00:57,950
to hello.

15
00:00:59,150 --> 00:01:02,000
And now next one going to be string.

16
00:01:02,000 --> 00:01:05,630
Going to be string two is equal to.

17
00:01:08,230 --> 00:01:09,520
How are you?

18
00:01:11,210 --> 00:01:11,660
Perfect.

19
00:01:11,660 --> 00:01:15,490
So for these two strains, how can I combine them together?

20
00:01:15,500 --> 00:01:19,360
And that's what you call concatenation for the plus operator.

21
00:01:19,370 --> 00:01:21,140
Let's see how we are going to do it.

22
00:01:21,140 --> 00:01:29,030
So as usual, let me assign the result into a variable called result equal to I would take the string

23
00:01:29,030 --> 00:01:35,540
one which represents hello and then I would add plus string two together.

24
00:01:35,750 --> 00:01:36,530
Perfect.

25
00:01:36,530 --> 00:01:43,550
So down here if I try to console.log the results here, let's see.

26
00:01:43,550 --> 00:01:46,250
We see that I have something happening here.

27
00:01:46,370 --> 00:01:47,840
Hello, how are you?

28
00:01:47,900 --> 00:01:54,920
We see that the first one, which is string one, is this particular.

29
00:01:54,920 --> 00:01:55,490
Hello.

30
00:01:55,850 --> 00:02:03,230
And then the string two, which is how are you is from here and this one and you can see that there

31
00:02:03,230 --> 00:02:04,970
is no space between them.

32
00:02:05,150 --> 00:02:11,150
So to do that, we're going to add some space between the hello and how are you.

33
00:02:11,180 --> 00:02:16,070
So this how you're going to do so after this one.

34
00:02:16,100 --> 00:02:23,120
After this, you're going to add additional double quotes space and then plus.

35
00:02:23,390 --> 00:02:26,930
So if I save it now something has happened.

36
00:02:26,930 --> 00:02:27,590
We have.

37
00:02:27,590 --> 00:02:29,420
Hello, how are you?

38
00:02:29,420 --> 00:02:30,630
So that's how we are.

39
00:02:30,650 --> 00:02:34,760
We can we can contact or combine string together.

40
00:02:35,030 --> 00:02:40,970
And then you also have one method using the contact method from JavaScript.

41
00:02:41,000 --> 00:02:42,500
So the same process.

42
00:02:42,500 --> 00:02:44,240
So let me comment out here.

43
00:02:44,330 --> 00:02:44,930
Okay.

44
00:02:45,080 --> 00:02:49,100
The next method is using the contact method.

45
00:02:49,580 --> 00:02:50,540
Contact.

46
00:02:51,550 --> 00:02:52,420
Mitt it.

47
00:02:53,190 --> 00:02:54,540
Like that.

48
00:02:54,930 --> 00:02:56,700
So how are we going to do it?

49
00:02:56,700 --> 00:02:57,710
So the same thing.

50
00:02:57,720 --> 00:02:59,730
So let me bring this one here.

51
00:03:00,150 --> 00:03:02,160
Copy it and then paste it here.

52
00:03:02,190 --> 00:03:03,820
This one is for operator here.

53
00:03:03,840 --> 00:03:07,260
So let me comment this one out like that.

54
00:03:07,260 --> 00:03:11,310
And now how can we contact this strength together?

55
00:03:11,740 --> 00:03:18,360
Okay, so I remove this one and then I'll bring in the first string.

56
00:03:18,390 --> 00:03:21,000
That is string number one, which is this one.

57
00:03:21,060 --> 00:03:24,630
And on that, I have a method called coin cat.

58
00:03:25,060 --> 00:03:25,670
Perfect.

59
00:03:25,680 --> 00:03:28,710
So before you move on, let me show you some tricks here.

60
00:03:29,340 --> 00:03:38,820
Anything that comes after DOT is either a method or a property of that particular variable that you

61
00:03:38,820 --> 00:03:40,260
want to work on.

62
00:03:40,560 --> 00:03:48,120
So we see that as soon as I type dot, the code is giving me some options that which methods do you

63
00:03:48,120 --> 00:03:48,910
want to use?

64
00:03:48,930 --> 00:03:56,900
And we have a bunch of them and I'll work you through most of these methods with some coding challenges.

65
00:03:56,910 --> 00:04:00,480
So for the meantime, let's stick to contact.

66
00:04:00,960 --> 00:04:06,830
So contact takes in some elements that you need to pass into this.

67
00:04:06,840 --> 00:04:11,610
So I want to contact meaning add string number two into that.

68
00:04:11,700 --> 00:04:19,529
So if I save it, if we see that I have as before, but you can see that there is no space between them

69
00:04:19,529 --> 00:04:20,029
here.

70
00:04:20,040 --> 00:04:29,460
So to add a space, you bring space here like that, you bring your double code space and then add plus

71
00:04:29,460 --> 00:04:29,840
here.

72
00:04:29,850 --> 00:04:35,850
So with this one, if I save it, you see that now everything is perfect as before.

73
00:04:35,860 --> 00:04:42,060
So that is about the string concatenation, how we can combine string together.

74
00:04:42,090 --> 00:04:43,820
This is really crucial.

75
00:04:43,830 --> 00:04:47,190
You need to pay attention how to combine string together.

76
00:04:47,220 --> 00:04:52,560
The next video we will talk about what is called JavaScript template literal.

