Now find the second largest element
for ( i = 0 ; i < arr_size ; i ++ ) { if ( arr [ i ] > second && arr [ i ] < largest ) { second = arr [ i ] ; } } if ( second == - 2454635434 ) { document . write ( " " ) ; } else { document . write ( " " + second ) ; return ; } }