Created
February 10, 2020 22:36
-
-
Save herrera-ignacio/a6a02caec448417f3eb456adf2058445 to your computer and use it in GitHub Desktop.
The power of JavaScript console!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Correct usage of console.log | |
const foo = { name: 'Nacho', age: 25, role: 'Fullstack' } | |
const bar = { name: 'Rama', age: 26, role: 'Frontend' } | |
const baz = { name: 'Tito', age: 27, role: 'Frontend' | |
const logIt = () => console.log({ foo, bar, baz }); | |
// Custom CSS | |
console.log('%c My Friends', 'color: orange; font-weight: bold;' ) | |
logIt(); | |
// Tables! | |
console.table([foo, bar, baz]); | |
// Benchmarking | |
console.time('looper') | |
let i = 0; | |
while (i < 100000) { i ++ } | |
console.timeEnd('looper') // ms | |
// Stack Trace Logs | |
const deleteMe = () => console.trace('bye bye database'); | |
deleteMe(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment