Hacker News new | ask | show | jobs
by nfriedly 5585 days ago
A couple of lines up you see this:

  Bar.prototype = new Foo();
Then, Bar.prototype.constructor == Foo()

So when you create a new instance of Bar, it's constructor still appears to be Foo even though it really isn't. Setting the prototype.constructor fixes that.