The easiest option:
b.prototype.foo = function () {
bar();
baz();
}
But if you make changes to a.prototype.foo, you will need to update b.prototype.foousing the same logic.
The best option:
b.prototype.foo = function () {
a.prototype.foo.call(this);
baz();
}
b.prototype.foo() a.prototype.foo(), . a.prototype.foo(), b.prototype.foo(), .