karmaMap.forEach(function(value, key, dosh) {
for (i = 0; i < karmaMap.size; i++) {
if(typeof leaderboard[i] === "undefined"){
leaderboard.splice(i, 0, value );
break;
}
if(value.totalCount > leaderboard[i].totalCount){
leaderboard.splice(i, 0, value );
break;
}
if(i+1 == karmaMap.size){
leaderboard.push(value);
}
}
});
Why did I do this... i literally rewrote the stupid .sort command. Rewrite this to not do this janked up sorting and just use a simple .sort?
If for some reason the util i'm using "Map()" doesn't have a sort function just leave it and close this issue. I just dont know why I did it like this looking back...
Why did I do this... i literally rewrote the stupid .sort command. Rewrite this to not do this janked up sorting and just use a simple .sort? If for some reason the util i'm using "Map()" doesn't have a sort function just leave it and close this issue. I just dont know why I did it like this looking back...