Earn extra honor and gain new allies!
Honor is earned for each new codewarrior who joins.
Learn more
Fundamentals
Arrays
Code
Diff
  • var thirdGreatest = (arr) => arr.sort((a,b) => b - a)[2];
  • 1-var thirdGreatest = (arr) => arr.sort((a,b) => a - b)[arr.length - 3];
    1+var thirdGreatest = (arr) => arr.sort((a,b) => b - a)[2];