diff options
| author | Syndamia <kamen.d.mladenov@protonmail.com> | 2021-10-29 16:13:22 +0300 |
|---|---|---|
| committer | Syndamia <kamen.d.mladenov@protonmail.com> | 2021-10-29 16:13:22 +0300 |
| commit | a04948e93a75a5aaf0bed796b028b4215d6b27c0 (patch) | |
| tree | 60738b423466f65d43aba8ab689be31e4e33e63d /TypeScript/ts-test1.ts | |
| parent | 6e34b60dddad5971436f24edd927f23a206e91cc (diff) | |
| download | Self-learning-a04948e93a75a5aaf0bed796b028b4215d6b27c0.tar Self-learning-a04948e93a75a5aaf0bed796b028b4215d6b27c0.tar.gz Self-learning-a04948e93a75a5aaf0bed796b028b4215d6b27c0.zip | |
Added old self learning typescript files
Diffstat (limited to 'TypeScript/ts-test1.ts')
| -rw-r--r-- | TypeScript/ts-test1.ts | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/TypeScript/ts-test1.ts b/TypeScript/ts-test1.ts new file mode 100644 index 0000000..8a2b915 --- /dev/null +++ b/TypeScript/ts-test1.ts @@ -0,0 +1,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; + } +} |
