Last active
August 12, 2022 11:13
-
-
Save amjedomar/ad6b8230edfaf38badf7000dffc58cfa to your computer and use it in GitHub Desktop.
Revisions
-
amjedomar revised this gist
Aug 12, 2022 . 1 changed file with 3 additions and 3 deletions.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 @@ -15,10 +15,10 @@ class Cat { } // access instance properties and methods const milo = new Cat('Milo'); console.log(milo.name); console.log(milo.getName()); // access static properties and methods console.log(Cat.count); -
amjedomar created this gist
Aug 12, 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,25 @@ class Cat { static count = 0; constructor(public name: string) { Cat.count++; } getName() { return this.name; } static getCount() { return this.count; } } // access instance properties and methods const cat = new Cat('Milo'); console.log(cat.name); console.log(cat.getName()); // access static properties and methods console.log(Cat.count); console.log(Cat.getCount());