Skip to content
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

Develop #2388

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Develop #2388

wants to merge 3 commits into from

Conversation

n3di
Copy link

@n3di n3di commented Sep 24, 2024

No description provided.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

Great job on the implementation! 👍 Just a few code style suggestions to keep in mind for the future: try to keep your code DRY by combining conditions when possible, avoid nesting ternary operators for better readability, and consider using anonymous functions when naming isn't necessary. These changes can help make your code even cleaner and easier to maintain! Keep up the good work!

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨

return a + b;
}
};
};

Choose a reason for hiding this comment

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

[CODE STYLE] - You don't need to name functions if you return them right away. Consider using anonymous functions instead to make the code cleaner. For example, return function (b) { ... };

Comment on lines 16 to 20
if (callCount > 3 && callCount % 2 === 0) {
return "Bzzz... Error!";
} else {
return a + b;
}

Choose a reason for hiding this comment

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

[CODE STYLE] - Try not to nest ternary operators. Instead, you can use a single conditional statement or separate the logic into multiple statements to improve readability.

Comment on lines 16 to 19
if (callCount > 3 && callCount % 2 === 0) {
return "Bzzz... Error!";
} else {
return a + b;

Choose a reason for hiding this comment

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

[CODE STYLE] - DRY. You can combine conditions to simplify the logic. For instance, you can check if callCount is less than or equal to 3 to return the sum directly, reducing the need for an else block.

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