Priya’s scorekeeper works. It adds points, starts and undoes rounds, removes players, and names the leader. It now lives in three files.
The exercises’ tests checked what the page shows after a set of clicks. They couldn’t check how you split the app into modules or whether you can say why the page stays accurate after an undo. When you know why, you can change the scorekeeper later without breaking it.
In this session, you’ll walk the mentor through your state.js, render.js, and main.js, explain why the data decides what the page shows, and then make a change that you haven’t seen in this course. You’ll come away knowing which parts of your code you can explain with confidence and which ones are worth another look.
Get set up first. Serve scratch/scores/index.html with Live Preview and keep the Console visible. Open the three files in your editor, too. If you haven’t done the brief’s last step yet, split scorekeeper.js into the three files now, as Project: Priya’s Score Keeper describes. Then run the brief’s table of clicks once more to confirm that the split app still works.
When you click the button below, the mentor opens in a new conversation. It starts by asking you to paste your three files. Then it checks what each file exports and imports, and it asks one question at a time about where the scores live, how one listener knows the row, and what each file owns.