Explain Your Season Log

You’ve built Ruth’s season log. It reports and skips the three bad runs, and once your debugging card showed why Kwame’s minutes came out as 03850, every member’s totals matched the club’s record.

The tests checked what your code does. They can’t check why you put each throw and each catch where you did, and those decisions are what you’ll carry into programs of your own.

In this review, you explain your season log to the mentor, and then you change it. The mentor asks where each error is thrown, why the import loop catches it, and how you tracked down Kwame’s total. Then Ruth finds a new problem in her file, one you haven’t seen yet, and you decide how the season log should handle it.

Before you start, put the whole season log back together. For the totals step, your main.js loaded checked.json and handed it straight to totalsByRunner(). Change it back so it loads runs.json with loadRuns() and sends those runs through importRuns(). Then it should print the kept runs with printSeason() and hand the same kept runs to totalsByRunner(). Otherwise, the change you make in this review never reaches your import.

Then open a terminal in your season-log folder and run node main.js with the same current Node.js LTS version you’ve used all along. Compare the output with the expected lines in the project brief. Keep it in your terminal, because the mentor will ask you to paste it, along with parts of check.js and load.js.

Locked learning resources

Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Already a member? Sign-In

Locked learning resources

The full lesson is for members only. Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Already a member? Sign-In

Become a Member to join the conversation.