Why this matters
he var keyword creates variables with function scope, leading to bugs and unexpected behavior. Use const for variables that don't change and let for those that do, to ensure block scoping.
Check for occurrences of var declarations. Using var leads to function scoping issues. Recommend using const for immutable values and let for mutable ones.
he var keyword creates variables with function scope, leading to bugs and unexpected behavior. Use const for variables that don't change and let for those that do, to ensure block scoping.
Side-by-side examples engineers can pattern-match during review.
// (no example provided)// (no example provided)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.