This rule checks that a declaration doesn't use a name that is already in use. Indeed, it is possible to use the same symbol multiple times as either a variable or a function, but doing so is likely to confuse maintainers. Further it's possible that such reassignments are made in error, with the developer not realizing that the value of the variable is overwritten by the new assignment.

This rule also applies to function parameters.

## Noncompliant Code Example

    function myFunc(arg) {
      var a = "Ayyyyye";
      var arg = "event"; // Noncompliant, argument value is lost
      var a = "Howdy";  // Noncompliant
    }

## Compliant Solution

    var a = 'foo';
    function otherName() {}
    console.log(a);

    function myFunc(arg) {
      var newName = "event";
    }

    fun(); // prints "foo"

    function fun() {
      print("foo");
    }

    fun(); // prints "foo"

    function printBar() {
      print("bar");
    }

    printBar(); // prints "bar"