Easy Tutorial
❮ Event Cancelable Prop Email Multiple ❯

JavaScript concat() Method

JavaScript String Object

Example

Concatenating two strings:

n Output result:


Definition and Usage

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.


Browser Support

All major browsers support the concat() method.


Syntax

Parameter Values

Parameter Description
string1, string2, ..., stringX Required. One or more string objects to be concatenated into a single string.

Return Value

Type Description
String A new string resulting from concatenating two or more strings.

Technical Details

| JavaScript Version: | 1.2 | | --- | --- |


More Examples

Example 2

Concatenating three strings:

n Output result:


JavaScript String Object

❮ Event Cancelable Prop Email Multiple ❯