Why this matters
The Object constructor is less readable and can lead to unexpected behavior. Object literals are safer and clearer.
Ensure that the Object constructor is not used. Object literals are clearer, more predictable, and improve readability.
The Object constructor is less readable and can lead to unexpected behavior. Object literals are safer and clearer.
Side-by-side examples engineers can pattern-match during review.
const foo = new Object();const foo = {};
const foo = new Object();const foo = {};
From the same buckets as this rule.
Check if loops use equality operators (== or !=) in termination conditions. These can lead to infinite loops if the condition is never met exactly. Instead, use relational operators like < or > for safer loop termination.