News for hackers. Stuff that matters.
Re:JavaScript debugging for beginners by mkoryak on Monday May 19, 2014 @08:37PM (#7770655)
Nice article. Not just for beginners either. Ive been debugging javascript since IE6 and didnt know about

"If you click the braces at the bottom of the developer tools, they will “pretty print” the code. It makes it a little bit more readable, but it’s still difficult to decipher.

(granted, javascript consoles were a bit different back then: http://notetodogself.blogspot.com/2008/08/debug-javascript-i...)

Re:JavaScript debugging for beginners by mvclark on Monday May 19, 2014 @06:50PM (#7770247)
Nice post. Another one I find useful is to define your own log function, e.g.,

function log(x) {console.log(x);};

You'd use log instead of console.log for debugging your code. Then, to turn off logging, you set

function log(x) {};

or have a boolean switch in log function to do a similar thing. You could even use this approach to define debug levels to enable/disable.

Re:JavaScript debugging for beginners by jasode on Monday May 19, 2014 @07:55PM (#7770530)
Instead of Ctrl+Shift+I, I usually use F12 because it works in all 3 browsers Chrome, Firefox, and IE. In IE, Ctrl+Shift+I brings up Favorites/Feeds/History.

However, on Mac OSX, Ctrl+Shift+I makes more sense because the default for F12 is to adjust sound volume up. You have to press Fn+F12 which is more awkward than Ctrl+Shift+I. (Or Cmd+Alt+I in Safari).