Depending on your browser, the log function may take several parameters. For example, Chrome supports the following:
console.log("User = ", data);
When you do this, data will appear in the object browser, which you can show / collapse the hierarchy. This is extremely helpful. Since I am developing in Chrome, I really prefer this method (more JSON.stringify ), because it prints less and debugging works better.
If you are stuck with debugging in a browser that does not support this syntax, then JSON.stringify is probably the best choice.
Brian genisio
source share