Finding gcd of all the numbers in the array
var gcd = 0 ; for ( i = 0 ; i < n ; i ++ ) gcd = __gcd ( arr [ i ] , gcd ) ; return gcd ; } function __gcd ( a , b ) { return b == 0 ? a : __gcd ( b , a % b ) ; }