If you use you might see this error: @typescript-eslint Prefer using nullish coalescing operator (??) instead of a logical or (||), as it is a safer operator. Why?????? Nullish coalescing operator Nullish coalescing is an improvement added to Typescript a while ago and officially added to 2020 Javascript. The main purpose is to simplify assigning default values. Let’s jump to the code: // Nullish coalescing console.log(0 ?? 'error') // 0 console.log('' ?? 'error') // '' console.log(null ?? 'error') // 'error' Nothing special? Have a look at how ‘OR’ would behave // 'good-old' OR operator console.log(0 || 'error') // 'error' console.log('' || 'error') // 'error' console.log(null || 'error') // 'error' See the difference? The OR operator will check for and for Javascript and are considered false in a boolean context. falsy 0 ’’ See what evaluates to . false here The operator on the other hand tests for and only. nullish coalescing null undefined Returning an or might be what we want. We don’t want Javascript to do with it anything else, just return the data! ’’ 0