The requested page is not available for the requested platform. You are viewing the content for Default platform.

Duplicate property declaration

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"
}