Function to find gcd of array of numbers
function findGCD ( arr , n ) { let result = arr [ 0 ] ; for ( let i = 1 ; i < n ; i ++ ) { result = gcd ( arr [ i ] , result ) ; if ( result == 1 ) { return 1 ; } } return result ; }