encyclopedia.ts 418 B

123456789101112131415161718
  1. import {ReferenceItem} from "./classes";
  2. class Encyclopedia extends ReferenceItem {
  3. constructor(newTitle: string, newYear: number, public edition: number) {
  4. super(newTitle, newYear);
  5. }
  6. printItem(): void {
  7. super.printItem();
  8. console.log(`Edition: ${this.edition} (${this.year}).`);
  9. }
  10. printCitation(): void {
  11. console.log(`${this.title} - ${this.year}.`);
  12. }
  13. }
  14. export default Encyclopedia;