Skip to content

Instantly share code, notes, and snippets.

@nepsilon
Last active February 19, 2017 13:50
Show Gist options
  • Save nepsilon/2b76a486edb88d6e80189fe7a23c02c8 to your computer and use it in GitHub Desktop.
Save nepsilon/2b76a486edb88d6e80189fe7a23c02c8 to your computer and use it in GitHub Desktop.
You think you know the Chrome Web console? — First published in fullweb.io issue #7

You think you know the Chrome Web console?

There is more than console.log() to the Chrome Web Console:

Output debug, info, warnings and errors:

console.debug('Just so that the dev know') 
console.info('Here is some info') 
console.warn('This may be a problem') 
console.error('This must not happen')

Assert results:

console.assert(nodeList.length < 500, "NodeList is > 500");

Ask for breakpoint in code:

debugger; //yes, that's it, just need to have this keyword on a line.

Output in a table:

console.table([[1,2,3], [4,5,6]]) 
console.table([{a:2, b:3}, {a:4, b:5}])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment