What's the JavaScript equivalent of Ruby's "inspect"?

Viewed 2645

In Ruby, you can do foo.inspect and it outputs something sane for any object pretty much regardless of type.

How do I achieve the same thing in JavaScript?

3 Answers
Related