JSFiddle - React, Tailwind, and code Playground
JavaScript
// Find third largest number in an array
const arr = [23, 89, 4, 56, 12];
function findThirdLargest(input) {
const sortedInput = input.sort((a,b) => b - a);
return sortedInput[2];
}
console.log(findThirdLargest(arr))