Array.join() : Join « Array « JavaScript Tutorial






Syntax

array.join()
    array.join(string)

The join() method converts all the elements to strings and then concatenates all the strings into a longer string.

If an argument is provided in the parameter list, it is used to separate the elements in the string returned by the method.

<html>
    <script language="JavaScript">
    <!--
    fruit = new Array("A","B","C");
    aString = fruit.join("-");  
    document.write("The fruit array contains: ",aString);
    -->
    </script>
</html>








11.17.Join
11.17.1.Array.join()
11.17.2.Join elements in an array
11.17.3.Seeming success in copying an array