---
title: Avoid Trailing Commas In Object Or Array Literals
description: "Impact Area Manageability Severity High Affected Element Lightning ## Rule ID **SF-0069** ## Impact Using trailing commas in object or array literals reduces code portability due to differences in how different browsers interpret these trailing commas. ## Remediation Remove any…"
url: "https://community-staging.qualityclouds.com/qcdocs/qc/pmd-rules/avoid-trailing-commas-in-object-or-array-literals/"
updated: "2025-03-21"
category: PMD Rules
---

# Avoid Trailing Commas In Object Or Array Literals

Impact Area

Manageability

           Severity

High

           Affected Element

Lightning

## Rule ID

**SF-0069**

## Impact

Using trailing commas in object or array literals reduces code portability due to differences in how different browsers interpret these trailing commas.

## Remediation

Remove any trailing commas from object or array literal definitions.

## Explanation

When an array is defined with a trailing `,` for some browsers this is ok, but others could fail to process it. The solution is simply to remove the trailing (last) comma from the array definition.

### Time to fix

30 min

## Original reference

[PMD: AvoidTrailingComma](https://pmd.github.io/latest/pmd_rules_ecmascript_errorprone.html#avoidtrailingcomma)
