How can I convert a JavaScript object into a string?
(如何将JavaScript对象转换为字符串?)
Example:
(例:)
var o = {a:1, b:2}
console.log(o)
console.log('Item: ' + o)
Output:
(输出:)
Object { a=1, b=2} // very nice readable output :)
(对象{a = 1,b = 2} //非常好的可读输出:))
Item: [object Object] // no idea what's inside :((Item:[object Object] //不知道里面是什么:()
ask by user680174 translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…