August 1999
Intermediate to advanced
1488 pages
72h 53m
English
array.toSource()
The toSource() method returns one string representing the source of the Array object. The string that is returned contains all the elements in the array separated with commas. The entire string is enclosed with brackets ([]) to show it is an array. If another array is contained within an array, its contents are also part of the string with its own set of brackets.
Listing 6.59 creates an Array object of colors and an Array object of numbers. The array of numbers is included in the array of colors. The toSource() method is then applied to the Array object to return the source string.
["Blue", "Green", "Red", ...
Read now
Unlock full access