JavaScript concat() Method
Complete String Object Reference
Definition and Usage
The concat() method is used to join two or more strings.
Syntax
stringObject.concat(stringX,stringX,...,stringX)
|
Parameter |
Description |
stringX |
Required. One or more string objects to be joined to a string |
Example
In the following example we will create two strings and show them as one using concat():
<script type="text/javascript">
var str1="Hello ";
var str2="world!";
document.write(str1.concat(str2));
</script>
|
The output of the code above will be:
Try-It-Yourself Demos
concat()
How to use concat() to join two strings.
Complete String Object Reference
 |

|
|
See why there are 20,000+ Ektron integrations worldwide.
Request an INSTANT DEMO or download a FREE TRIAL today. |
|
|
|