-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Figure Classes #22
base: master
Are you sure you want to change the base?
Figure Classes #22
Conversation
src/figuresClasses.ts
Outdated
} | ||
|
||
export class Circle { | ||
export class Triangle implements Figure { | ||
shape: Shape; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shape: Shape ====> public shape = Shape.triangle
src/figuresClasses.ts
Outdated
public b: number, | ||
public c: number, | ||
) { | ||
this.shape = Shape.triangle; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may remove "this.shape" if you adhere your code to the suggestion I left above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
погоджуюсь, це код можна прибрати, якщо створити shape як через public і зразу записати в нього triangle
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, the code is good! Left one suggestion above
src/figuresClasses.ts
Outdated
public b: number, | ||
public c: number, | ||
) { | ||
this.shape = Shape.triangle; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
погоджуюсь, це код можна прибрати, якщо створити shape як через public і зразу записати в нього triangle
src/figuresClasses.ts
Outdated
} | ||
|
||
getArea(): number { | ||
const p: number = (this.a + this.b + this.c) / 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
не прописуй тип для константи він і так завжди буде як число і ніколи не зміниться
No description provided.