welcome

多用生姜洗发水,多喝养生枸杞茶,

JS判断两个数是否能除尽

   function judgeDivisor(m, n) {
            var num = {};
            var i = 0;
            var x = parseInt(m / n);
            m = m % n;
            var result = "";
            while (m != 0 && !(m in num)) {
                num[m] = i++;
                result += parseInt(m * 10 / n);
                m = m * 10 % n;
            }
            return m == 0;
        }

 

posted on 2020-07-18 00:10  成天吐槽的菜鸡前端  阅读(1151)  评论(0编辑  收藏  举报