Skip to content

Instantly share code, notes, and snippets.

@yannbertrand
Last active July 17, 2016 04:38
Show Gist options
  • Save yannbertrand/15bf4fe13b8f17bba332 to your computer and use it in GitHub Desktop.
Save yannbertrand/15bf4fe13b8f17bba332 to your computer and use it in GitHub Desktop.
Some console tips
/**
* console.log
*/
console.log('Hello');
// → "Hello"
var hello = 'Hello';
console.log(hello);
// → "Hello"
var world = 'World';
console.log(hello, world, '!');
// → "Hello" "World" "!"
/**
* console.time & console.timeEnd
*/
console.time('counter');
// → counter: timer started
// Some long operations
console.timeEnd('counter');
// → counter: 5820.91ms
/**
* console.table
*/
var object = [
{
title: hello,
content: 'Good morning everyone'
},
{
title: world,
content: 'Planet Earth'
}
];
console.table(object);
// Let the magic happen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment