Skip to content

Solution#2422

Open
OlkowskaK wants to merge 10 commits into
mate-academy:masterfrom
OlkowskaK:develop
Open

Solution#2422
OlkowskaK wants to merge 10 commits into
mate-academy:masterfrom
OlkowskaK:develop

Conversation

@OlkowskaK

Copy link
Copy Markdown

No description provided.

Comment thread src/makeRobotAccountant.js Outdated
Comment on lines +16 to +18
return a + b;
} else {
return callCount % 2 === 0 ? "Bzzz... Error!" : a + b;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

"return sum" logic is duplicated, which makes it harder to read and maintain.
We can simplify it by combining the conditions into a single if statement.

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