Performance: Safe navigation operator for null
MEDIUM IMPACT
This affects rendering speed by preventing unnecessary errors and re-renders caused by null or undefined values in templates.
<div>{{ user?.address?.city }}</div><div>{{ user.address.city }}</div>| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Direct property access without safe navigation | Normal | Triggers extra change detection if errors occur | Normal | [X] Bad |
| Using safe navigation operator (?.) | Normal | Single change detection cycle without errors | Normal | [OK] Good |