class Point {
// fields _x, _y
constructor(private _x: number, private _y: number) {}
// property x
get x() {
console.log(this._x);
return this._x;
}
set x(value: number) {
this._x = value;
}
// method
drawPoint() {
....
}
}
Created
April 4, 2019 04:34
-
-
Save ivankisyov/36e4a7dc5648ea65373d79e2bebc0cd5 to your computer and use it in GitHub Desktop.
[TS] class props and fields
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment