Function to calculate product of digits between given indexes
function digitProduct ( digits , start , end ) { let pro = 1 ; for ( let i = start ; i <= end ; i ++ ) { pro *= digits [ i ] ; } return pro ; }