Skip to content

Instantly share code, notes, and snippets.

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