Javascript sort
\nvar frequencySort = function(nums) {\n  const map = new Map()\n  for(let n of nums){\n    map.set(n, (map.get(n) || 0)+1)\n  }\n  return nums.sort((a,b)=>{\n 
```\nvar frequencySort = function(nums) {\n  const map = new Map()\n  for(let n of nums){\n    map.set(n, (map.get(n) || 0)+1)\n  }\n  return nums.sort((a,b)=>{\n    if(map.get(a) === map.get(b)){\n      return b-a\n    }else{\n      return map.get(a) - map.get(b)\n    }\n  })\n};\n```
['Sorting', 'JavaScript']