class Book {
constructor(title, author, pages) {
this.title = title;
this.author = author;
this.pages = pages;
}
function getPageCount() {
return this.pages;
}
function getAuthor() {
return this.author;
}
function getTitle() {
return this.title;
}
}
class Novel extends Book {
constructor(title, author, pages, genre) {
super(title, author, pages);
this.genre = genre;
}
function getGenre() {
return this.genre;
}
}
let book = new Novel('The Hobbit', 'J.R.R. Tolkien', 310, 'Fantasy');
Created
April 30, 2019 16:17
-
-
Save raynerpupo/47acda72556f0f9124b11d2bd0d03c57 to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment