Dealing with deeply nested objects can be a headache, especially when you're not sure if every level of the data actually exists. Instead of writing long chains of logic like if (user && user.profile && user.profile.settings), use the optional chaining operator (?.). Writing user?.profile?.settings will safely return undefined if any part of the chain is missing, preventing your app from crashing and keeping your code much cleaner.
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)