진수전환

2진수를 10진수로

const n = '101';
const r = parseInt(n, 2); // 5

10진수를 2진수로

const n = 5;
const r = n.toString(2); // 101

Last updated