Function to find index of value in arr [ start ... end ] The function assumes that value is postsent in in [ ]
function search ( arr , strt , end , value ) { let i ; for ( i = strt ; i <= end ; i ++ ) { if ( arr [ i ] == value ) break ; } return i ; }