Responded to @kasparsd:
Optional Chaining & Nullish Coalescing π ES2020
const what = user?.profile?.name ?? 'N/A';
Reads the value of name without undefined crashes, and returns 'N/A` if not present.
Responded to @kasparsd:
Optional Chaining & Nullish Coalescing π ES2020
const what = user?.profile?.name ?? 'N/A';
Reads the value of name without undefined crashes, and returns 'N/A` if not present.