Optional Chaining Lookup

Operators ยท medium

Implement `getCity(user)` returning `user.address.city` using optional chaining, or the string `Unknown` when any part is missing.

Loading...

Run your code to see results.