js greatest common divisor of two numbers

function countDivior(a,b) {

      if(b===0) {

           return a;

     } else {

          countDivior(b,a%b);

     }

}

Guess you like

Origin www.cnblogs.com/zhang-jiao/p/12243403.html