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?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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:
Object.inspect(link)jquery-inspect(link) plugin