UNDERSTAND
Bring these concepts with you
BUILD
Your implementation
- Implement requestJson with same-origin credentials and JSON request bodies. Check response.ok: fetch resolves on 401 and 403.
- Implement renderDashboard. Show the form or dashboard from server-confirmed identity, replace invoice rows, announce status, and disable buttons while busy.
- Use textContent for user IDs and invoice fields. Keep session credentials in the HttpOnly cookie; do not copy tokens into JavaScript storage.
export async function requestJson(path, options = {}, fetcher = fetch) {
// Fetch, parse JSON, classify HTTP failures.
}
export function renderDashboard(state, root = document) {
// Derive the visible interface from state.
}Need a hint?
- The controller calls render with a state snapshot. Render from that snapshot instead of keeping a second hidden truth in DOM flags.
- Thrown errors may include a status field. Preserve it so session expiry can be handled differently from a network failure.
Saved on this device · 0 / 6000 · Do not include passwords or private data.
VERIFY
Acceptance checks
From the folder containing your downloaded files, run:
node checks.mjs ./starter.mjs 2This runs checks up to this step. Earlier steps must work first. Mark each result only after checking your implementation; the website does not run or grade it.
Record your attempt to enable the checklist and reference comparison.
Compare with the reference
Attempt the step first, then compare decisions and behavior. There can be more than one correct implementation.
EXPLAIN
Your interviewer asks
Why does a successful fetch promise not mean the request succeeded? Where should you store the login token?
Say your answer aloud, then record the trade-offs and evidence in your notes above.
LOCAL VOICE REHEARSAL
Rehearse your step walkthrough aloud
00:00/ 02:00