Use console.log() like a pro (2020)
11–20 of 156 posts
Re: Use console.log() like a pro (2020)
#12Re: Use console.log() like a pro (2020)
#13 %s – string
%i or %d – integer
%o or %O – object
%f – float
Why were these ever specific types, instead of just one option that looks at the parameter type?Re: Use console.log() like a pro (2020)
#14Not gonna lie, read this hoping to pat myself on the back for being a pro, twist: learned some cool stuff, console.memory()? Neato!
Re: Use console.log() like a pro (2020)
#15Another trick that might be more practical for actually debugging is using the object shorthand. For example, instead of... console.log(x, y); which contains the information you need, but lacks any useful context, try... console.log({x, y}); ...which will print out like an object, including the key names.
Re: Use console.log() like a pro (2020)
#16Another trick that might be more practical for actually debugging is using the object shorthand. For example, instead of... console.log(x, y); which contains the information you need, but lacks any useful context, try... console.log({x, y}); ...which will print out like an object, including the key names.
Re: Use console.log() like a pro (2020)
#17%s – string %i or %d – integer %o or %O – object %f – float Why were these ever specific types, instead of just one option that looks at the parameter type?
laughs in JS
Re: Use console.log() like a pro (2020)
#18Re: Use console.log() like a pro (2020)
#19%s – string %i or %d – integer %o or %O – object %f – float Why were these ever specific types, instead of just one option that looks at the parameter type?