What is concatenation?
Are you preparing for IT certification? With practice questions, study notes, interactive quizzes, tips and technical articles, uCertify PrepKits ensure that you get a solid grasp of core technical concepts to ace your certification exam in first attempt.
What is concatenation?
Rating:
Concatenation is the process of joining two or more strings. Strings can be joined in three ways:
- + operator
- += operator
- concat function
Each of them is shown with an example as follows:
- The + operator
- The += operator
- The concat function
The + operator can be used to concatenate the strings as follows:
alert("My name is "+name)
The output is shown in the image below:

The += operator can be used as follows:
tag+="<head><title>My web page </title></head>"
tag+="<body><p>This is my first web page </body>
tag+="</html>"
The output is shown in the image below:

The concat function belongs to a string object and it can be used to combine strings. The following code will demonstrate this:
The output is shown in the image below:

Rating:
Was this information helpful?
Other articles
- What is the checked property?
- Arrays
- What is the replace() method?
- What is the DateFormat class?
- What is a parameter?