整数を配列に分解
code: digToArr.js
const digToArr = (n,d) => {
const ret = [];
for(let i = 0;n > 0;++i,n = (n/d)|0) { ret
i
= n % d; }
return ret;
}