• + 0 comments

    function getSecondLargest(nums) { // Complete the function

    nums.sort((a, b) => a - b);
    let Largest = nums[nums.length-1] ;
    for(let i=0 ; i <=nums.length-1 ; i++){
     if(nums[i] == (Largest)-1){
         return nums[i];
     }
    
    
    }
    

    }