Loading ...
Sorry, an error occurred while loading the content.

705Re: console read only

Expand Messages
  • sandyhead25
    Jul 5, 2009
    • 0 Attachment
      --- In jslint_com@yahoogroups.com, "Noah Peters" <boyopeg@...> wrote:
      >
      > --- In jslint_com@yahoogroups.com, "Douglas Crockford" <douglas@> wrote:
      > >
      > > --- In jslint_com@yahoogroups.com, "Noah Peters" <boyopeg@> wrote:
      > > >
      > > > With the newest version of JSLint I am having a frequent error on this code block:
      > > >
      > > > if (typeof console==="undefined") {
      > > > console = {
      > > > log: function() {},
      > > > dir: function() {},
      > > > trace: function() {}
      > > > }
      > > > }
      > >
      > > Either turn off the Assume a Browser option, or add this comment:
      > >
      > > /*global console: true*/
      > >
      >
      > Awesome, thanks!
      >

      Why would you use
      typeof(console) === "undefined"
      instead of
      console === undefined
      which should be the same thing, but faster?
    • Show all 18 messages in this topic