There should be atleast two elements
if ( n < 2 ) { document . write ( " " ) ; return ; } let firstSmallest = Number . MAX_VALUE ; let secondSmallest = Number . MAX_VALUE ; for ( let i = 0 ; i < n ; i ++ ) {