join two array string using concat()

     concat method is used to join two or more arrary or strings. This method does not change the existing(old) value, but return the joined value(new value).

Syntax

string1.concat(string2);

or

array1.concat(array2);


Example 1

var str1="Allinworld";

var str2="99";



alert(str1.concat(str2));



Example 2

 var ar1 = ["A","B","C"];
 var ar2 = ["D","E","F"];

alert(ar1.concat(ar2));



Example Program:- (Editor)


Editor is Loading...

Advertisement

0 nhận xét:

Đăng nhận xét