News for hackers. Stuff that matters.
Re:Advanced console.log Tips and Tricks (2020) by repsilat on Tuesday June 15, 2021 @10:20PM (#27524164)
My dumb dead-simple trick that you've probably independently invented yourself: when I want to log variables x,y,z I write

console.log({x,y,z})

not

console.log(x,y,z)

Who needs pretty-printing, formatting libraries, string interpolation etc?

Re:Advanced console.log Tips and Tricks (2020) by msikora on Wednesday June 16, 2021 @01:23AM (#27525177)
Yep, I have "invented" this myself as well :)
Re:Advanced console.log Tips and Tricks (2020) by NegativeLatency on Wednesday June 16, 2021 @01:52AM (#27525324)
And the old version with json.stringify
Re:Advanced console.log Tips and Tricks (2020) by andra_nl on Wednesday June 16, 2021 @01:27AM (#27525202)
Same here.