Ranking methods: Difference between revisions

Content added Content deleted
Line 801: Line 801:
ns = [44, 42, 42, 41, 41, 41, 39],
ns = [44, 42, 42, 41, 41, 41, 39],


sorted = xs.map(function (a, b) {
sorted = xs.map(function (x, i) {
return { name: a, score: ns[b] };
return { name: x, score: ns[i] };
}).sort(function (a, b) {
}).sort(function (a, b) {
var c = b.score - a.score;
var c = b.score - a.score;