Find GCD(Greatest common denominator) of fraction and reduce it
function fractionReducing(fraction) {
var gcd = function gcd(a,b){
return b ? gcd(b, a%b) : a;
};
gcd = gcd(fraction[0],fraction[1]);
return [fraction[0]/gcd,fraction[1]/gcd];
}