Skip to content

Instantly share code, notes, and snippets.

@droidjahangir
Last active September 16, 2021 04:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save droidjahangir/61ecdd6e3d3c829fda3310e79ae383b4 to your computer and use it in GitHub Desktop.
Save droidjahangir/61ecdd6e3d3c829fda3310e79ae383b4 to your computer and use it in GitHub Desktop.
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