Otherwise
else document . write ( arr [ K ] ) ; } function reverse ( a ) { let i , k , t ; let n = a . length ; for ( i = 0 ; i < n / 2 ; i ++ ) { t = a [ i ] ; a [ i ] = a [ n - i - 1 ] ; a [ n - i - 1 ] = t ; } } function count ( a , n ) { let freq = 0 ; for ( let i = 0 ; i < a . length ; i ++ ) { if ( a [ i ] == n ) freq ++ ; } return freq ; }