If the absolute difference of current pair ( i , j ) is greater than the maximum difference calculated till now , update the value of result .
result = Math . max ( result , calculateDiff ( i , j , array ) ) ; } } return result ; }