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

Nhận xét

Bài đăng phổ biến từ blog này

How to set the SDK, NDK and JDK path to android studio?

physicsjs - Increase the restitution value for circle and retangle

Select all values from list box in a single click using javascript