← Quiz: Classes, Modules, Map and Set: all 10 questions
Quiz: Classes, Modules, Map and Set · Question 6 of 10
In a child class constructor, what must happen before you use this?
In a child class constructor, what must happen before you use this?
- A.Nothing
- B.You must call this.init()
- C.You must call super(...)
- D.You must export the class
Answer & explanation
Correct answer: You must call super(...)
The parent constructor sets up the object; JavaScript throws an error if this is used first.
Can you get the rest right without peeking?
Take the timed Quiz: Classes, Modules, Map and Set quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →