Skip to content

Instantly share code, notes, and snippets.

@Lexhoo
Created May 24, 2020 19:48
Show Gist options
  • Save Lexhoo/dd87f87973c3609a40f44881718bd97c to your computer and use it in GitHub Desktop.
Save Lexhoo/dd87f87973c3609a40f44881718bd97c to your computer and use it in GitHub Desktop.
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