Stop writing deeply nested if statements or long && chains just to check if a property exists. Use optional chaining (?.) to safely access nested properties without throwing an error if a parent is null. Pair this with the nullish coalescing operator (??) to provide a fallback value only when the result is null or undefined. Unlike the logical OR (||), it won't trigger on "falsy" values like 0 or an empty string, which prevents a lot of common UI bugs.
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)