Skip to content

HW#3 Khyzhniak#5

Open
dmytro-khyzhniak wants to merge 4 commits intomasterfrom
HW3_Khyzhniak
Open

HW#3 Khyzhniak#5
dmytro-khyzhniak wants to merge 4 commits intomasterfrom
HW3_Khyzhniak

Conversation

@dmytro-khyzhniak
Copy link
Collaborator

No description provided.

Comment on lines +4 to +13
function sum(a = 0) {
let sum = a;

return a === 0 ? a :
function add(b) {
return b === undefined ? sum : (
sum += b,
add
)
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • " a" / "b" not the best names, try to give more informative names. in this case you can use "argument"
  • just as a spelling option "return a ?? add"

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree

parent: treeRoot,
children: []
};
treeRoot.children.push(treeFirstLevel2);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you do additional calculation operations instead of describing the whole tree at once?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's from an example. I was following the instructions.

@dmytro-khyzhniak dmytro-khyzhniak changed the title HW#3 Khyzhniak - done. HW#3 Khyzhniak Mar 10, 2021
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