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

1814Re: Bad variable names

Expand Messages
  • Douglas Crockford
    Jan 25, 2011
    • 0 Attachment
      --- In jslint_com@yahoogroups.com, "Ezequiel" <thehungerforce@...> wrote:
      > Well, JSLint already has this.
      >
      > ie.
      >
      > var String = '';
      >
      > => Problem at line 1 character 5: Redefinition of 'String'.
      >
      > JSLint doesn't see this as an issue if we do it inside a function, however.
      >
      > Whether you initialize that var inside or outside a function, it still has the same effect of redefining "String."


      That's not true at all. var String inside of a function declares a local variable that can only be seen by the code you put into that function with it. That is nothing like redefining a primordial global variable.
    • Show all 9 messages in this topic