Daily Dev Tip
A new tip every day. Bookmark this page.
JavaScript
Use optional chaining (?.) to safely access nested properties
const name = user?.profile?.name ?? 'Unknown';
A new tip every day. Bookmark this page.
const name = user?.profile?.name ?? 'Unknown';