2

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

VisioN
  • 143,310
  • 32
  • 282
  • 281
user3328513
  • 189
  • 1
  • 3
  • 12

1 Answers1

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);

Live Demo

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
  • The OP just need to see his object. `console.log` is good enough. – Lewis Jun 30 '14 at 11:21