<!--
title: Use nullish coalescing
domain: ai-agents
topic: Null Handling
language: TSX
source: RooCodeInc/Roo-Code
updated: 2025-06-23
url: https://awesomereviewers.com/reviewers/roo-code-use-nullish-coalescing/
-->

When providing default values for numeric properties, use the nullish coalescing operator (??) instead of logical OR (||). This ensures that valid zero values are preserved rather than being replaced with defaults. Using || will treat 0 as a falsy value and replace it with the default, which is often unintended behavior for numeric settings.

This pattern is especially important for numeric configurations like thresholds, ranges, and input values where zero is a valid and meaningful value that should not be overridden.
