Skip to content

Instantly share code, notes, and snippets.

@jpwco
Last active March 24, 2022 19:41
Show Gist options
  • Save jpwco/b5fe58b0df5bba79bff3efb5eadc804e to your computer and use it in GitHub Desktop.
Save jpwco/b5fe58b0df5bba79bff3efb5eadc804e to your computer and use it in GitHub Desktop.
Refactoring example #1 after
class Department {
name;
printName() {
console.log("Department name: " + this.name);
}
printMeeting() {
console.log("The Accounting Department meets each Monday at 10am.");
}
}
class AccountingDepartment extends Department {
generateReports() {
console.log("Generating accounting reports...");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment