JavaScript String.prototype.concat() Method
The concat() method joins strings onto the end of a string and returns the result as a new string.
Description
The concat() method returns a new string made by joining the given strings to the original. In practice the + operator and template literals are more common and just as fast.
Arguments that aren't strings are converted to strings first, so numbers, booleans and objects are added as their string forms, and arrays are joined with commas. The original string is never changed; concat() always returns a new one.
For joining a list of values with a separator, Array.prototype.join() is clearer. Template literals, `${a} ${b}`, are the most readable choice when mixing text with values, and engines optimize +, += and template literals well, so there is no performance reason to prefer concat().
Syntax
string.concat(str1, str2, ...)Parameters
- str1, str2, ...Strings (or values converted to strings) to add to the end.
Return Value
A new string with the arguments joined to the end.
Example
Browser Support
The following information will show you the current browser support for the String.prototype.concat() method. Hover over a browser icon to see the version that first introduced support for this method.
Desktop





Tablets & Mobile





