JavaScript: Array.prototype.toString

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

JS Obj Reference

Array

prototype