Skip to content

Instantly share code, notes, and snippets.

View Matthew-Troost's full-sized avatar
🔨
Building things

Matthew Troost Matthew-Troost

🔨
Building things
View GitHub Profile

Keybase proof

I hereby claim:

  • I am matthew-troost on github.
  • I am matthewtroost (https://keybase.io/matthewtroost) on keybase.
  • I have a public key ASDLImKzYErPs5Ifk-6ca3Qz0yLCKfP7SpYbt9jhNIJmnAo

To claim this, I am signing this object:

@Matthew-Troost
Matthew-Troost / ObjArrayFunctions
Created June 22, 2019 12:53
Chaser Code Test
function orderByRanking(objArray) {
return objArray.sort((a,b) => (a.ranking > b.ranking) ? 1 : ((b.ranking > a.ranking) ? -1 : 0));
}
function avarageRanking(objArray){
return objArray.reduce((total, next) => total + next.ranking, 0) / objArray.length;
}