Skip to content

task was solved#1675

Open
ihor-soloviov wants to merge 1 commit into
mate-academy:masterfrom
ihor-soloviov:develop
Open

task was solved#1675
ihor-soloviov wants to merge 1 commit into
mate-academy:masterfrom
ihor-soloviov:develop

Conversation

@ihor-soloviov

Copy link
Copy Markdown

No description provided.

@Avichez Avichez left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Good solution 👍
But there is something that still needs and could be fixed, checklist 2 for sure 🙂

Comment thread src/makeRobotAccountant.js Outdated
let counter = 0;

return (numberOne) => {
const result = (numbertwo) => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

According to cheklist 2, it will be better to make a direct return of the function.

Suggested change
const result = (numbertwo) => {
return (numbertwo) => {

Comment thread src/makeRobotAccountant.js Outdated

return (numberOne) => {
const result = (numbertwo) => {
const sum = numberOne + numbertwo;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Just to simplify, you can directly return the result of this expression.

Suggested change
const sum = numberOne + numbertwo;
return numberOne + numbertwo;

Comment thread src/makeRobotAccountant.js Outdated
Comment on lines +15 to +16
if (counter > 3) {
return counter % 2 === 0

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

If following the comment above, here will be better to move the expression counter % 2 === 0 to if statement.

Suggested change
if (counter > 3) {
return counter % 2 === 0
if (counter > 3 && counter % 2 === 0) {
return 'Bzzz... Error!';

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I had no thinking that it's possible. Now it's fixed.

@alexandra-protyanova alexandra-protyanova left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Fix previous comments

@ihor-soloviov ihor-soloviov requested review from Avichez and alexandra-protyanova and removed request for Avichez January 10, 2023 10:37
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.

4 participants