analytics script bug fix

This commit is contained in:
2025-06-27 14:44:05 +05:30
parent a8136b8175
commit 76e703d5f0

View File

@@ -180,6 +180,8 @@ function calculateAverages(arr) {
// Sort array for median calculation (slice to avoid mutating original)
const sorted = [...cleanArr].sort((a, b) => a - b);
const count = sorted.length;
const sum = sorted.reduce((acc, val) => acc + val, 0);
const average = sum / count;
// Calculate median