Join two strings:
The result of res will be:
More "Try it Yourself" examples below.
The concat() method is used to join two or more strings.
This method does not change the existing strings, but returns a new string containing the text of the joined strings.
Method | |||||
---|---|---|---|---|---|
concat() | Yes | Yes | Yes | Yes | Yes |
Parameter | Description |
---|---|
string1, string2, ..., stringX | Required. The strings to be joined |
Return Value: | A new String, containing the text of the combined strings |
---|---|
JavaScript Version: | 1.2 |
Join three strings:
The result of res will be: