This is the course’s first coding exercise, so here’s how the editor and its tests work before you weigh any evidence.
How Coding Exercises Work
A coding exercise runs right here in your browser, so you don’t need your terminal or your second-draft-books clone for it. The editor above holds a file that you can change. In this exercise, the file starts with the gap ids and kinds of evidence in comments, then the two functions you write, and ends with four made-up changes to try them on.
When you click Run Tests (or press Ctrl+Enter, Cmd+Enter on macOS), automated tests load your file and call your functions on the four changes, and on more changes they make up each time they run. The list of tests then marks each one as passed or failed.
When a test fails, read its message before you change anything. It tells you what your function returned, what the evidence does or doesn’t cover, and which part of the last lesson to revisit, and that’s usually the clue you need. Some tests wait for an earlier test to pass. Fix the first failing test, and the ones waiting on it follow.
If every test fails with the same short error, such as Unexpected token ‘export’, then JavaScript couldn’t read your file at all. A brace or a comma is usually missing, and the error names what it tripped over.
Run the tests early and often, even before you change anything, so that you can see what a failure looks like. If the editor feels cramped, then the Full screen button gives it the whole window, and the Hints tab has nudges if you get stuck.