Skip to main content

Duplicate property declaration

In This Article

Note

The Duplicate property declaration code issue is JavaScript specific.

CodeRush Classic shows the Duplicate property declaration code issue if a property is declared two or more times.

#Fix

Remove redundant property declaration or rename one of duplicated properties.

#Purpose

Highlights duplicate property declarations, which denote an ambiguity in your code.

#Example

person = {
    name:"John",
    Age: 29,
    name:"John Smith"
}

Fix:

person = {
    name:"John",
    Age: 29,
    fullname:"John Smith"
}