// 10์ง์ -> 2์ง์ ๋ณํ
let dec = 160;
let arrBi = [];
while (dec) {
arrBi.push(dec % 2);
dec = Math.floor(dec / 2);
}
console.log(arrBi.reverse().join(''));
// 10์ง์ -> 2์ง์ ๋ณํ (2๋ฒ์งธ ๋ฐฉ๋ฒ)
let dec = 160;
console.log(dec.toString(2));
์ฒซ๋ฒ์งธ ๋ฐฉ๋ฒ๊ณผ ๋๋ฒ์งธ ๋ฐฉ๋ฒ ๋ฐ๋ก๋ฐ๋ก ์ฝ์์ ์ ๋ ฅํด์ผํฉ๋๋ค!