News for hackers. Stuff that matters.
Re:Ask HN: JavaScript dev environment ? by maxanger on Saturday July 03, 2010 @02:27PM (#1484193)
if (window.console) console.log(...);
Re:Ask HN: JavaScript dev environment ? by jackowayed on Saturday July 03, 2010 @02:40PM (#1484222)
That really should be built in to console.log.
Re:Ask HN: JavaScript dev environment ? by mitjak on Saturday July 03, 2010 @03:19PM (#1484285)
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.
Re:Ask HN: JavaScript dev environment ? by ydant on Saturday July 03, 2010 @03:43PM (#1484313)
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.