aboutsummaryrefslogtreecommitdiff
path: root/TypeScript/ts-test1.ts
blob: 8a2b9150db37e318b203fe0f8da886b8365ebee6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
class Person {
	private _name: string;

	set name(value: string) {
		if (value == "Pesho")
			throw new Error("Nah fam");
		this._name = value;
	}

	get name() {
		return this._name;
	}

	constructor(name: string) {
		this.name = name;
	}
}