Skip to Content
JavaScript Intermediate: Write Code That Doesn't Fall Apart When the Data Changes
Intermediate
0 likes
Courses
JavaScript Intermediate: Write Code That Doesn't Fall Apart When the Data Changes

Check Yourself: Prove It Works Before Someone Else Finds Out

Five scenario questions on try/catch, custom errors and tests. If you miss more than one, reread the lesson that covers it.

Course content

Sign in to save your progress.

Course Home
1. You validate a form and throw ValidationError for bad fields. In catch, what should happen to other errors?
3. try { saveLater(); } catch {} doesn't catch an error thrown inside the async function saveLater. Why?
4. Your test expect(applyDiscount(425, 10)).toBe(382.5) fails with "expected 42.5 to be 382.5". What do you do first?

About

Five scenario questions on try/catch, custom errors and tests. If you miss more than one, reread the lesson that covers it.

Duration
5 min
Last update
08/29/2026
Was this helpful?
​ 0 ​ 0

Comments (0)

Sign in to comment

No comments yet.