• + 0 comments

    In JS

    function getSecondLargest(nums) {
        // Complete the function
        let dupl = [...new Set(nums)];
    let arr = dupl.sort((a,b)=> a-b);
      
        let res = arr[arr.length-2]
        return res; 
    }