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" ); // true
// note: no bracket in result
console.log( [[1,[2]], 5].toString() === "1,2,5" ); // true
// note: no bracket in result, even for nested array
console.log( [3, {k:4}].toString () === "3,[object Object]" ); // true
JS in Depth
XAH  BUY NOW

JS in Depth

JS Obj Ref

DOM


JS Obj Ref

Array

prototype