JS: Array.prototype.toString

By Xah Lee. Date: . Last updated: .
arrayX.toString()
Return a string representation of arrayX.
[3, 4].toString() === "3,4"
// note: no bracket in result
[[1, [2]], 5].toString() === "1,2,5"
// note: no bracket in result, even for nested array
[3, { k: 4 }].toString() === "3,[object Object]"
BUY ΣJS JavaScript in Depth

JavaScript, Array to String