In this video.
Let's talk about string concatenation, meaning how can we combine two or more strings together?
And that's what you call string concatenation.
So let me comment out all these ones for future references.
And now let's begin a new concept.
So we're down here.
Down here, let's comment here and you have this comment that is a new topic.
So string.
Concatenation.
We have couple of ways of combining strings together.
The first one is using the plus operator.
So let's see, how can we combine strains together?
So let's say that I have this two counts and I would need my first string and string one which is equal
to hello.
And now next one going to be string.
Going to be string two is equal to.
How are you?
Perfect.
So for these two strains, how can I combine them together?
And that's what you call concatenation for the plus operator.
Let's see how we are going to do it.
So as usual, let me assign the result into a variable called result equal to I would take the string
one which represents hello and then I would add plus string two together.
Perfect.
So down here if I try to console.log the results here, let's see.
We see that I have something happening here.
Hello, how are you?
We see that the first one, which is string one, is this particular.
Hello.
And then the string two, which is how are you is from here and this one and you can see that there
is no space between them.
So to do that, we're going to add some space between the hello and how are you.
So this how you're going to do so after this one.
After this, you're going to add additional double quotes space and then plus.
So if I save it now something has happened.
We have.
Hello, how are you?
So that's how we are.
We can we can contact or combine string together.
And then you also have one method using the contact method from JavaScript.
So the same process.
So let me comment out here.
Okay.
The next method is using the contact method.
Contact.
Mitt it.
Like that.
So how are we going to do it?
So the same thing.
So let me bring this one here.
Copy it and then paste it here.
This one is for operator here.
So let me comment this one out like that.
And now how can we contact this strength together?
Okay, so I remove this one and then I'll bring in the first string.
That is string number one, which is this one.
And on that, I have a method called coin cat.
Perfect.
So before you move on, let me show you some tricks here.
Anything that comes after DOT is either a method or a property of that particular variable that you
want to work on.
So we see that as soon as I type dot, the code is giving me some options that which methods do you
want to use?
And we have a bunch of them and I'll work you through most of these methods with some coding challenges.
So for the meantime, let's stick to contact.
So contact takes in some elements that you need to pass into this.
So I want to contact meaning add string number two into that.
So if I save it, if we see that I have as before, but you can see that there is no space between them
here.
So to add a space, you bring space here like that, you bring your double code space and then add plus
here.
So with this one, if I save it, you see that now everything is perfect as before.
So that is about the string concatenation, how we can combine string together.
This is really crucial.
You need to pay attention how to combine string together.
The next video we will talk about what is called JavaScript template literal.