After reading this discussion and this article, I still have this question. Let's say I have the following snippet:
var arr = new Array(3);
arr[0] = "Zero";
arr[1] = "One";
arr[2] = "Two";
document.write(arr.join(","));
If I replace the document.write()
line with document.write(arr);
, are they equivalent? Does the replacement statement automatically join array elements with a comma as the delimiter?
Thanks in advance!