Array.toSource() : toSource : Array JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Array » toSource »

 

Array.toSource()










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>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Array
» toSource