3 Ways to Level Up Your Console Statements

q: how do you comfort a javascript bug?
a: ๐˜บ๐˜ฐ๐˜ถ ๐˜ค๐˜ฐ๐˜ฏ๐˜ด๐˜ฐ๐˜ญ๐˜ฆ ๐˜ช๐˜ต
โ €
๐Ÿฆ— ๐Ÿฆ— ๐Ÿฆ— ๐Ÿฆ— ๐Ÿฆ—
โ €
i think my sense of humor is correlated with the amount of social interaction iโ€™ve been getting these days aka close to none :โ€™)
โ €
๐Ÿ๐จ๐ซ๐ญ๐ฎ๐ง๐š๐ญ๐ž๐ฅ๐ฒ, my love of bug squashing has not deteriorated so let me share some of my favorite console tips that will level up your console.log(โ€œblahโ€) game ๐Ÿ•ต๏ธโ€โ™€๏ธ๐Ÿ•ต๏ธโ€โ™€๏ธ
โ €
swipe to see the samples โžก๏ธ
โ €
๐šŒ๐š˜๐š—๐šœ๐š˜๐š•๐šŽ.๐š๐šŠ๐š‹๐š•๐šŽ
great way to display iterables && when you want to impress whoever is pair programming with you

console table example


โ €
๐šŒ๐š˜๐š—๐šœ๐š˜๐š•๐šŽ.๐šŠ๐šœ๐šœ๐šŽ๐š›๐š
when youโ€™re lazy to do if statements - just use console.assert(condition, msg) to log something when the condition is falsy

console assert example


๐šŒ๐š˜๐š—๐šœ๐š˜๐š•๐šŽ.๐š•๐š˜๐š(โ€œ%๐šŒ ๐š–๐šŽ๐šœ๐šœ๐šŠ๐š๐šŽโ€, ๐šœ๐š๐šข๐š•๐šŽ)
when youโ€™re feeling extra and want to spice up your console logs

console style example


happy debugging everyone! ๐Ÿ› ๐Ÿ•ท ๐Ÿœโค๏ธ

original post on instagram: https://www.instagram.com/p/B_V6eQRHXW_/