Skip to content

Commit

Permalink
Update array.js
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigo-roca authored Jun 4, 2024
1 parent d052dad commit f003205
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 f003205

Please sign in to comment.