CORE MISSION
Make an Unreliable Banking API Safe for the Dashboard
Protect the dashboard from missing nested data, null values, and optional fields. Create a new safe view model without mutating the API response.
Skills
destructuring · defaults · optional chaining · ?? · spread · immutable update
🏦 Scenario
A banking dashboard receives customer/account data from an API. The API is not always complete: nested profile data may be missing, balance may be null, and some records do not contain accountType. The UI must never crash.
📋 Requirements
0 / 7
Start by safely reading the nested name with optional chaining.
For
null/undefined, consider
??. Use spread when creating a new object.
🧭 Guideline Solution
ก้าวทีละ Step — เปิดเฉพาะขั้นที่ติด ไม่ต้องดูเฉลยทั้งหมด
🤖 AI Challenge
Ask Copilot/AI to make the code defensive. Then review the generated code.
Look specifically for || vs ??.
Do not regenerate the whole solution after finding one mistake.