125, how to conver to binary number?spa
function DecimalToDinary (n) { let temp = n; let list = []; if (temp <= 0) { return '0000'; } while (temp > 0) { let rem = temp % 2; list.push(rem); temp = parseInt(temp / 2, 10); } return list.reverse().join(''); } console.log(DecimalToDinary(125)) // 1111101