SHARE
TWEET

Untitled

a guest Jun 25th, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function orderedByRanking(mainObj) {
  2.   return mainObj.sort((a,b) => (a.ranking > b.ranking) ? 1 : ((b.ranking > a.ranking) ? -1 : 0));
  3. }
  4.  
  5. function averageRanking(mainObj) {
  6.   let total = 0;
  7.   mainObj.map((a) => (total = total + a.ranking));
  8.   return (total / mainObj.length);
  9. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top