August 1999
Intermediate to advanced
1488 pages
72h 53m
English
array.toString()
The toString() method returns one string that contains all the elements in the array separated with commas. You may be wondering why anyone would need this method when the join() method can do this and more. The reason is that the toString() method is what JavaScript uses to automatically convert an array to a string when the array is used in string context.
Caution
JavaScript 1.2 does not use commas to separate the elements. Instead, each element is enclosed in square brackets.
Table 6.17 shows the return value associated with the toString() method.
| Type | Item | Description ... |
|---|
Read now
Unlock full access