How can I turn [object Object] to a string so I can see what's actually in the array. I tried toString()
but that produced the same result as before
Asked
Active
Viewed 382 times
2

VisioN
- 143,310
- 32
- 282
- 281

user3328513
- 189
- 1
- 3
- 12
-
see:: http://stackoverflow.com/questions/5612787/converting-an-object-to-a-string – Sudhir Bastakoti Jun 30 '14 at 11:20
-
Object.prototype.toString.call(myVar) -http://stackoverflow.com/questions/8511281/check-if-a-variable-is-an-object-in-javascript – Mark Walters Jun 30 '14 at 11:21
-
@Sudhir I would rather point to the question about debugging in JavaScript. – VisioN Jun 30 '14 at 11:22
1 Answers
3
It's possible with the method JSON.stringify()
:
alert(JSON.stringify(yourObject));
Or with console.log()
(visible in your debugger javascript, like Firebug) :
console.log(yourObject);

R3tep
- 12,512
- 10
- 48
- 75
-
`console.log` with `JSON.stringify` will look horrible at the end. Don't mix them up if you don't really need to do it. – VisioN Jun 30 '14 at 11:20
-