Last active
September 16, 2021 04:18
-
-
Save droidjahangir/61ecdd6e3d3c829fda3310e79ae383b4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Department { | |
name: string; | |
constructor(n: string) { | |
this.name = n; | |
} | |
describe(this: Department) { | |
console.log('Department: ' + this.name); | |
} | |
} | |
const accounting = new Department('Accounting'); | |
accounting.describe(); | |
const accountingCopy = { name: 'DUMMY', describe: accounting.describe }; | |
console.log(accountingCopy); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment