The parent constructor must run before this is used, or the error cannot be built.
Acceptance criteria
- 1.#out should show name is required.
The parent constructor must run before this is used, or the error cannot be built.
class ValidationError extends Error { constructor(message) { this.name = "ValidationError"; } } let result; try { throw new ValidationError("name is required"); } catch (error) { result = error instanceof ValidationError ? error.message : "the error could not be built"; } document.querySelector('#out').textContent = result;
Output ready when you are
Press Run to render your code, or Submit to validate your solution.