-
Notifications
You must be signed in to change notification settings - Fork 0
HW#5 Khyzhniak #16
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
base: master
Are you sure you want to change the base?
HW#5 Khyzhniak #16
Conversation
| for (let i = 0; i < groupOfPeople.length; i++) { | ||
| if (groupOfPeople[i].age >= 18) adultPartOfGroup.push(groupOfPeople[i]); | ||
| } |
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.
pls, try do not use "if" statement in one line. we can technically do this, but it hurts readability
HW5(OOP_vs_FP)/HW5_Khyzhniak.js
Outdated
| isAdmin = null; | ||
|
|
||
| constructor(nickname) { | ||
| this.nickname = nickname ?? 'Guest'; |
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.
and how we could make an emulation of the fact that this class is ABSTRACT?
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.
Added throwing an error when trying to create an instance of an abstract class.
HW5(OOP_vs_FP)/HW5_Khyzhniak.js
Outdated
| function pow(base) { | ||
| return function(exp) { | ||
| return base ** exp; | ||
| } | ||
| } | ||
|
|
||
| console.log(pow(2)(2)) // 4 |
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.
the essence of the closure is not shown, while I see only currying
No description provided.