The elements in the array are converted to strings and are concatenated together to form a larger string.
This is functionally identical to using the join() method with no join string argument.
If you run the example, it will yield the following:
This is quite different to what you get if you use the toSource() method which presents this result:
["one", 2, "III"]
The result of this method is a String primitive version of the array assembled by concatenation.
In that circumstance, the array is presented with enclosing square brackets. This means that it can be used as an array literal in an eval() function. This behavior was added in anticipation of the ECMA specification supporting some additional functionality. However, the standard mandates very specific behavior for toString().
// Create an array and display it as a string myObject = new Array("one", 2, "III"); document.write(myObject.toString());