The join method fuses the elements of an array into one character string, with the specified delimiter character to separate elements.
If you specify no delimiter character, a comma is used.
If you want no delimiter to show, specify a delimiter of double quote: "".
Code:
<script type="text/javascript"> //<![CDATA[
array1 = new Array("G", "l", "o", "r", "i", "a"); joinedString1 = array1.join(); document.write(joinedString1, "<br>"); joinedString2 = array1.join("-"); document.write(joinedString2, "<br>"); joinedString3 = array1.join(""); document.write(joinedString3, "<br>"); //]]> </script>
Output: