You can extend your DigitalClock
and AnalogueClock
with your base class. Something like following would do.
DigitalClock.prototype = new baseClock();
AnalogueClock.prototype = new baseClock();
So DigitalClock and AnalogueClock will inherit the methods of baseClock. Another option could be to use mixin and extend both classes with it.