Skip to content

Commit

Permalink
Update array.js
Browse files Browse the repository at this point in the history
  • Loading branch information
juan-fernandez authored Jun 4, 2024
1 parent fdfd7f3 commit a09cc71
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/array.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function findMin(arr) {
// Function to calculate the average of numbers in an array
function calculateAverage(arr) {
// **INTELLIGENT TEST RUNNER**: Uncomment this line to test Intelligent Test Runner
// if (!Array.isArray(arr) || arr.length === 0) return null;
if (!Array.isArray(arr) || arr.length === 0) return null;
const sum = arr.reduce((a, b) => a + b, 0);
return sum / arr.length;
}
Expand Down

0 comments on commit a09cc71

Please sign in to comment.