Javascript – Keeping matching elements in their place while sorting an array
I’m trying to sort an array of 6 integers in descending order(javascript) but keep matching values in their place as the other values are sorted. An example is posted below to help explain this problem: Input: 4, 2, 5, 4,…