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?
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?
This is possibly not the entirely general answer you're hoping for, since this introduces third-party dependencies into you application. However, they're worth mentioning: