"
I received a code review from a colleague and they said it would be better to separate out the DOM manipulation code into a class method for readability, i.e. so it wasn't all inside the constructor." - not just that, but it also shouldn't be
called from inside the constructor. The constructor should only concern itself with setting up the instance properties. That way, your subclass can finish initialisation before the method is called. —
Bergi 32 secs ago