Fundamentals
Arrays
Code
Diff
  • const thirdGreatest = a => [...a].sort((a,b) => b - a)[2];
  • 1var thirdGreatest = a => JSON.parse(JSON.stringify(a)).sort((a,b) => b - a)[2];
    1+const thirdGreatest = a => [...a].sort((a,b) => b - a)[2];