Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
maxanger
· 16y ago · 0 comments
if (window.console) console.log(...);
Comments
[–]
jackowayed
16y ago
That really should be built in to console.log.
[–]
mitjak
16y ago
I may not be entirely sober yet but I believe the problem at hand is what happens when window.console isn't defined at all.
[–]
ydant
16y ago
It can be, but only if console.log is defined in your source code. It isn't when you use Firebug, so it won't be when you're not using Firebug.