Returns a string value containing the concatenation of two or more supplied strings.
|
---|
string1.concat([string2[, string3[, . . . [, stringN]]]]) |
Arguments
-
string1
-
Required. The String object or literal to which all other specified strings are concatenated.
-
string2,. . ., stringN
-
Optional. String objects or literals to concatenate to the end of string1.
Remarks
Example
The following example illustrates the use of the concat method when used with a string:
| Copy Code |
---|
function concatDemo(){
var str1 = "ABCDEFGHIJKLM"
var str2 = "NOPQRSTUVWXYZ";
var s = str1.concat(str2);
// Return concatenated string.
return(s);
} |
Requirements
See Also