Input
nthlargest([ 43, 56, 23, 89, 88, 90, 99, 652], 4)
Output
89
- nthlargest([ 43, 56, 23, 89, 88, 90, 99, 652], 4) returns 89.
- nthlargest([ 10, 100, 1000, 10000], 2) returns 1000.
function nthlargest(arr, highest) {
// write your code here
return
}
const arr = [43, 56, 23, 89, 88, 90, 99, 652];
const highest = 4;
console.log(nthlargest(arr, highest));