Is there a 3rd party add-on/application or some way to perform object map dumping in script debugger for a JavaScript object?
Here is the situation... I have a method being called twice, and during each time something is different. I'm not sure what is different, but something is. So, if I could dump all the properties of window (or at least window.document) into a text editor, I could compare the state between the two calls with a simple file diff. Thoughts?
The var_dump equivalent in JavaScript? Simply, there isn't one. Prints an interactive listing of all properties of the object. This looks identical to the view that you would see in the DOM tab.
Method 1 — Use console.log() method called with an object or objects as arguments will display the object or objects. Of course, not all JavaScript is developed in or can be debugged in browsers — so developers may be using alert() instead of console. log() .
console.log("my object: %o", myObj)
Otherwise you'll end up with a string representation sometimes displaying:
[object Object]
or some such.
Firebug + console.log(myObjectInstance)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With