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