This tutorial explains the String concat() method. Are you looking for the Array concat() method?
Using the concat() Method with One Argument
The concat() method accepts either a declared string as variable, or an anonymous string (a fragment of quoted text). Likewise, the concat() method can be applied on either on a declared string variable (as shown below), or on an anonymous string (see two scripts down).
alert( carter.concat(" to make better websites.") );
Our script declared a string variable, and used the concat() method to generate a new string by appending the anonymous string passed as argument. Note that our original string remains untouched.
We created our new string by applying the concat() method on a declared variable, and passing an anonymous string as argument. The exact same result can be achieved by doing the reverse:
var carter = new String(" to make better websites.");
Don't forget to use a connecting period (.) to join your quoted strings with the concat() method.
alert( carter + " and CSS" );
// Same as: carter.concat(" and CSS");
The last line of code returns the following string:
Using the concat() Method with Multiple Arguments
The concat() method takes at least one argument, but accepts multiple string arguments, separated by commas. The script below declares two strings, and uses the concat() method to concatenate (join) the initial strings with a third one, passed as argument.
var carter2 = "having fun.";
alert( carter1.concat( " and I am ", carter2 ) );
We limited ourselves to two arguments, but you can (theoretically) pass as many strings as you want to the concat() method.
Test the concat() Method