javascript easy understanding
\nvar getStrongest = function(arr, k) {    \n\t// sort array so we can easily find median\n    const sorted = arr.sort((a,b) => a-b)\n\t// get index of median\n
```\nvar getStrongest = function(arr, k) {    \n\t// sort array so we can easily find median\n    const sorted = arr.sort((a,b) => a-b)\n\t// get index of median\n\tconst medianIndex = Math.floor(((sorted.length-1)/2))\n\t// get median\n    const median = sorted[medianIndex]\n\n\t// custom sort function following the parameters given us in the description\n    const compareFunction = (a, b) => {\n        if (Math.abs(a-median) > Math.abs(b-median)) {\n            return 1\n        }\n        else if (Math.abs(a-median) === Math.abs(b-median) && a > b) {\n            return 1\n        } else {\n            return -1\n        }\n    }\n    \n\t// sort array using our custom sort function\n    const strongest = arr.sort(compareFunction).reverse().slice(0,k);\n    \n    return strongest;\n};\n```
['JavaScript']