-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
base: master
Are you sure you want to change the base?
task solution #2384
Conversation
There was a problem hiding this 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! ✨
return callCount <= 3 || callCount % 2 !== 0 | ||
? firstNumber + secondNumber | ||
: 'Bzzz... Error!'; |
There was a problem hiding this comment.
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!'; | ||
}; | ||
}; |
There was a problem hiding this comment.
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.
There was a problem hiding this 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.
No description provided.