Tuesday, January 8, 2019

javascript - Converting an object to a string

How can I convert a JavaScript object into a string?



Example:



var o = {a:1, b:2}
console.log(o)

console.log('Item: ' + o)


Output:




Object { a=1, b=2} // very nice readable output :)
Item: [object Object] // no idea what's inside :(


No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...