Luciano Mammino 馃摍 Node.js Design Patterns @loige.co 路 May 5

console.log() is probably the first function I ever used in Node.js... And yet, I was today years old when I learned it supports format strings! 馃く 馃У馃憞

71 likes 9 replies

?

Replies

Adrian 饢ェ饢ぃ饟嫾 路 May 5

Neat! I didn't know that either 馃槷

byhow 路 May 5

haven鈥檛 been impressed in the npm world for a while but this is honestly fire 馃槶

RayPoly 路 May 18

I knew it since a long time ago, but it's one of those things that I never got to use it on a daily basis and I forgot. Now I wish I had remember, thank you for bring it it back!

Ally 路 May 5

馃く STFU! Thats insane! Oh cant wait to try these!

Max.vue 路 May 6

I am more and more using inline 'debugger' statement. I find it time saving. Though didn't know either about format string. Go style 馃槑

Angel 路 May 5

馃く whoa same

Daniel Bayley 馃嚭馃嚘 路 May 6

See also other `console` methods, like `console.dir`.

Luciano Mammino 馃摍 Node.js Design Patterns 路 May 5

Most people use it like this (which is what I have been doing for years): ``` console.log('Event:', JSON.stringify(data)); ``` But you can save yourself some typing by using placeholders in the first argument.