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

720[jslint] Re: console read only

Expand Messages
  • sandyhead25
    Jul 8, 2009
    • 0 Attachment
      --- In jslint_com@yahoogroups.com, Marcel Duran <contact@...> wrote:
      > by "work" I meant "will evaluate the expression" not the result itself.again:
      > if console is not defined, your test, if (console === undefined) will raise
      > a ReferenceError exception.
      > If you still don't believe, try it yourself, go into your firebug console
      > and type:
      > if (foobar === undefined) {}
      > and run...
      > assuming foobar wasn't prior defined elsewhere you'll get a "ReferenceError:
      > foobar is not defined" message.
      > Marcel

      I have discovered the root of this complication. If a variable is declared but not assigned or not used this text works perfectly fine. If the variable is never declared the test fails. If you were attempting to evaluate declarations for potentially unknown namespace conflicts this is the way to go. Otherwise, why not always declare your variables at the top of your function to avoid such problems?
    • Show all 18 messages in this topic