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

task solution #2384

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

task solution #2384

wants to merge 1 commit into from

Conversation

W3zzie
Copy link

@W3zzie W3zzie commented Sep 2, 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 your Pull Request! Just a couple of tips to make your code even better: try using anonymous functions when you're returning them directly, it can make your code cleaner. Also, avoid nesting ternary operators as it can make the code hard to read; if-else statements could be clearer in those cases. Keep up the good work! 😊👍

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

Comment on lines +15 to +17
return callCount <= 3 || callCount % 2 !== 0
? firstNumber + secondNumber
: 'Bzzz... Error!';

Choose a reason for hiding this comment

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

[CODE STYLE] - Don't nest ternary operators. It's better to use if-else statements for clarity and maintainability of the code.

? firstNumber + secondNumber
: 'Bzzz... Error!';
};
};

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. Use anonymous functions instead.

Copy link

@Zibi95 Zibi95 left a comment

Choose a reason for hiding this comment

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

LGTM! It would be perfect if you first store the result in a variable and then return that variable. This approach will make the code easier to debug in the future.

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.

3 participants