The join method can be used in JavaScript to create a string from an array.
var aryTest = [7,5,8,19,6];
var strTest = aryTest.join();
document.write(strTest);
The preceding example takes a JavaScript array and applies the join method on it to create a string. The join method takes one optional parameter: The delimiter that separates the values. The default is a comma.
Related Articles:
JavaScript split Method – Create Array From String