参考:leetcode 方法:辗转相除法
const gcd = (a, b) => { if (b == 0) return a; return gcd(b, a % b); }; console.log(gcd(48,1000)); // 8