map/scoring.js
2026-05-20 17:15:09 +09:00

5 lines
138 B
JavaScript

export function weightedScore(terms) {
let total = 0;
for (const [value, weight] of terms) total += value * weight;
return total;
}