A child constructor must call super before using this.
Acceptance criteria
- 1.#out should show Rex.
A child constructor must call super before using this.
class Animal { constructor(name) { this.name = name; } } class Dog extends Animal { constructor(name) { this.tag = name; } } let result; try { result = new Dog("Rex").name; } catch (error) { result = "this was used too early"; } document.querySelector('#out').textContent = result;
Output ready when you are
Press Run to render your code, or Submit to validate your solution.