// issue: This function does not handle empty arrays.
function calculateAverage(numbers) {
return numbers.reduce((sum, num) => sum + num, 0) / numbers.length;
}
// suggestion: Consider adding a check for an empty array to avoid division by zero.
For more examples, checkout Conventional Comments website.
π Learn more
If you would like to learn more about Vue, Nuxt, JavaScript or other useful technologies, checkout VueSchool by clicking this link or by clicking the image below:
Vue School Link
It covers most important concepts while building modern Vue or Nuxt applications that can help you in your daily work or side projects π
β
Summary
Conventional Comments bring structure and efficiency to code reviews, helping developers communicate feedback more effectively. By using predefined comment types, teams can reduce confusion, improve code quality, and foster a more productive review process. Consider adopting this approach in your next code review to see the benefits firsthand!
Take care and see you next time!
And happy coding as always π₯οΈ