From 27e23cdd5608f6fb468c581a0944caf63d6c1705 Mon Sep 17 00:00:00 2001 From: tactonbishop Date: Tue, 20 Sep 2022 13:30:05 +0100 Subject: [PATCH] Last Sync: 2022-09-20 13:30:05 --- Programming_Languages/TypeScript/Classes.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Programming_Languages/TypeScript/Classes.md b/Programming_Languages/TypeScript/Classes.md index 27ac169..b332d26 100644 --- a/Programming_Languages/TypeScript/Classes.md +++ b/Programming_Languages/TypeScript/Classes.md @@ -2,8 +2,7 @@ categories: - Programming Languages -tags: - - typescript +tags: [typescript, OOP] --- # Classes @@ -65,7 +64,7 @@ The main points to note are: In order to create an object instance of `Age`, we can use the standard constructor function, viz: ```js -const mum = new Age('Mary Jo', 1959); +const mum = new Age("Mary Jo", 1959); console.log(mum); /* Age { personName: 'Mary Jo', birthYear: 1959 } */ @@ -74,7 +73,7 @@ console.log(mum); But given that classes define objects, we can also now use `Age` as a new custom type and define an object that way ```jsx -const thomas: Age = new Age('Thomas', 1988); +const thomas: Age = new Age("Thomas", 1988); ``` ### Without constructor @@ -118,3 +117,7 @@ class Programmer implements Person { employed: () => boolean } ``` + +## Inheritance + +### `implements` vs `extends`