If search_element is found with right variable
if ( arr [ right ] == search_Element ) { position = right ; document . write ( " " + ( position + 1 ) + " " + ( length - right ) + " " ) ; break ; } left ++ ; right -- ; }