Skip to content

Instantly share code, notes, and snippets.

View kambleaa007's full-sized avatar
🎯
Focusing

Ashish Kamble kambleaa007

🎯
Focusing
View GitHub Profile
@kambleaa007
kambleaa007 / code
Created June 24, 2019 11:19
code for function
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
}