|
|
JavaScript concat() Method
JavaScript String Object
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 |
Example
Example
Join two strings:
<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 »
|
JavaScript String Object
The Creators of XMLSpy are Pleased to Announce
|
|
|