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