I'm new to javascript and am trying to create a function that accepts an array of any length, and creates a new array with the rankings from that array (ie [10, 5, 20] would output [2, 3, 1]. This is my code so far ( i originally tried with a larger series of for loops finding the max each time but ran into issues getting them to repeat the same number of times as there are numbers in the array, so I switched to a sort method. Let me know if anyone can help point me in the right direction, thank you!!

```
function rankings(array){
  let finalArray = [];
 for (i = 0; i < array.length; i++) {//set up final array
  finalArray[i] = array[i];
   }
  for(let list of array){
    array.sort((a,b)=>b-a)//array sorted in order
    }
    for (i = array.length-1; i>=0; i--){

    }
  return finalArray;
}

```