5 hands-on exercises and 5 find-the-bug challenges for the JavaScript Promises lesson. Every one is checked automatically in the browser — write the code, run it, and the tests tell you what still fails.
Make a promise that resolves with a name and report it.
Reject a promise and report the reason with catch.
Use a ready-made resolved promise and report its value.
Resolve twice and show only the first value is kept.
Report the order of a synchronous line and a then handler.
Nothing calls resolve, so the handler never runs.
A rejected promise is handled by catch, not by then.
Ready to write the code?
The editor, the automatic checks and the worked solutions open up with an account.
Open the workspaceThe value only exists inside then.
The work succeeded, so the promise should resolve.
then belongs to the promise, not to what it resolves with.