The following block of code (JavaScript) is the solution of a Ranking function which accepts an array of numbers and returns an array of their ranks. Could anybody clearly explain how it works ?
function rankingSystem(arr) {
return arr.map((x, y, z) => z.filter(w => w > x).length + 1);
}