JavaScript Console Debugging Demo
A simple demo showing some lesser well-known JavaScript debugging techniques. This code makes use of the excellent prism.js for showing code snippets in HTML with a few custom tweaks.
The demo covers :-
- Using
console.table
to generate formatted output for objects and arrays. - Simple tips around the Chrome Live debugging issue.
- Structured logging using groups.
- Timings using
console.time()
. - Using
console.trace()
to get an instant call stack without the need for multiple console.logs across functions. - Conditional logging using
console.assert()
. - How to use CSS in
console.log()
with a slightly ridiculous demo.