Created
May 24, 2020 19:48
-
-
Save Lexhoo/dd87f87973c3609a40f44881718bd97c 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
import assert from 'assert'; | |
class Person { | |
private name: string; | |
private age: number; | |
constructor (name: string, age: number) { | |
this.name = name; | |
this.age = age; | |
} | |
tellMyName() { | |
return `I am ${this.name}`; | |
} | |
tellMyAge() { | |
return `I am ${this.age} years old`; | |
} | |
} | |
const john = new Person('John', 40); | |
const mary = new Person('Mary', 35); | |
console.log(john); | |
console.log(mary); | |
export default assert; | |
import assert from 'assert'; | |
class Person { | |
private name: string; | |
private age: number; | |
constructor (name: string, age: number) { | |
this.name = name; | |
this.age = age; | |
} | |
tellMyName() { | |
return `I am ${this.name}`; | |
} | |
tellMyAge() { | |
return `I am ${this.age} years old`; | |
} | |
} | |
const john = new Person('John', 40); | |
const mary = new Person('Mary', 35); | |
console.log(john); | |
console.log(mary); | |
export default assert; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment