Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Ashish Kamble kambleaa007

🎯
Focusing
View GitHub Profile
@kambleaa007
kambleaa007 / code
Created Jun 24, 2019
code for function
View code
function retByOrder(var arr){
return arr.sort((a,b) => (a.rank > b.rank) ? 1 : ((b.rank > a.rank) ? -1 : 0));
}
function retByAverage(){
var it = arr.values();
var avg=0;
for(let i=0;i<arr.length;i++){
avg = avg+it.next().value
}