Skip to content

HW#5 Khyzhniak#16

Open
dmytro-khyzhniak wants to merge 6 commits intomasterfrom
HW5_Khyzhniak
Open

HW#5 Khyzhniak#16
dmytro-khyzhniak wants to merge 6 commits intomasterfrom
HW5_Khyzhniak

Conversation

@dmytro-khyzhniak
Copy link
Copy Markdown
Collaborator

No description provided.

@dmytro-khyzhniak dmytro-khyzhniak marked this pull request as ready for review March 11, 2021 20:02
Comment on lines +26 to +28
for (let i = 0; i < groupOfPeople.length; i++) {
if (groupOfPeople[i].age >= 18) adultPartOfGroup.push(groupOfPeople[i]);
}
Copy link
Copy Markdown
Owner

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

isAdmin = null;

constructor(nickname) {
this.nickname = nickname ?? 'Guest';
Copy link
Copy Markdown
Owner

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?

Copy link
Copy Markdown
Collaborator Author

@dmytro-khyzhniak dmytro-khyzhniak Mar 15, 2021

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.

Comment on lines +337 to +343
function pow(base) {
return function(exp) {
return base ** exp;
}
}

console.log(pow(2)(2)) // 4
Copy link
Copy Markdown
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants