In a coding exercise, you type code in the editor on this page and then click Run Tests. Automated tests check whether your code does what the instructions ask. Anyone can read the instructions and type in the editor, and running the tests is for members.
Run the tests early and often, even before you change anything. Each run saves your code to your account, so you can pick up where you left off later, even on another device. Code that you type but never run isn’t saved, so run the tests before you step away.
When a test turns red, work through these steps in order:
- Read the test’s message. It tells you what went wrong, and often what to try next.
- Open the Hints tab. Hints appear one at a time, from a broad nudge to a specific one.
- Ask Mentor AI about the exact test or message that has you stuck.
- Open the Solution tab last. It unlocks after your first run. Use it to compare your finished code with one possible answer.
If every test shows the same short error, JavaScript couldn’t read your code at all. Check your quote marks and brackets first.
An exercise counts as completed once all its required tests pass. Tests marked Bonus are optional extras, and reading the solution doesn’t complete the exercise. For more room, click Full screen, or press T when you’re not typing in the editor.