Created
January 25, 2022 11:05
Revisions
-
GeoffreyHervet created this gist
Jan 25, 2022 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ class MyClass { constructor(private name: string){} func1 = () => { return this.name; } func2() { return this.name; } } const object = new MyClass('MyName'); console.log(object.func1()); console.log(object.func2()); console.log('~'.repeat(10)); [ object.func1, object.func2 ].forEach(funcToCall => { console.log(funcToCall()); })