Loading exercise...

Exercise: Check the Set's Coverage

This is the course’s first coding exercise, so here’s how exercises on RealJS work before you start on the task.

How Coding Exercises Work

A coding exercise runs right here in your browser, with no key and no model call. Write your code in the editor above, then click Run Tests or press Ctrl+Enter (Cmd+Enter on macOS). Automated tests run your function on recorded data and mark each test as passed or failed.

Run the tests early and often, even before you change anything. A failing test’s message says what the tests found and what they expected, so read it before you edit. Fix the first failing test, then run the tests again. A different failing test usually means you made progress. Some tests also run your code on data they make up on every run, so code that only fits the example data won’t pass.

Getting stuck is normal. The Hints tab nudges you one step at a time, so see whether one hint is enough to get you going. Working it out yourself is where most of the learning happens. You can also ask your mentor about the exercise and your code at any time.

For more room, click Full screen or press T while you’re not typing in the editor. When you’re done, open the Solution tab to compare your approach and read the notes.

Become a Member to join the conversation.