Array.toSource() : toSource « Array « JavaScript Tutorial






The toSource() method returns one string representing the source of the Array object.

The string contains all the elements in the array separated with commas.

The entire string is enclosed with brackets ([]).

If another array is contained within an array, its contents are also part of the string with its own set of brackets.

<html>
    <script language="JavaScript">

    <!--
    numbers = new Array(3,6,7);
    colors = new Array("Blue","Green","Red",numbers);
    aString = colors.toSource();  
    document.write(aString); 
    -->

    </script>

</html>








11.33.toSource
11.33.1.Array.toSource()
11.33.2.Two dimensional array toString