Returns a string value containing the concatenation of two or more supplied strings.
string1.concat([string2[, string3[, . . . [, stringN]]]])
The result of the concat method is equivalent to: result = string1 + string2 + string3 + … + stringN. A change of value in either a source or result string does not affect the value in the other string. If any of the arguments are not strings, they are first converted to strings before being concatenated to string1.
The following example illustrates the use of the concat method when used with a string:
function concatDemo(){ var str1 = "ABCDEFGHIJKLM" var str2 = "NOPQRSTUVWXYZ"; var s =str1.concat(
str2)
; // Return concatenated string. return(s); }
Addition Operator (+) | Array Object | concat Method (Array) | String Object Methods
Applies To: String Object