Contact: aviboots(AT)netvision.net.il
40,764 questions
53,140 answers
573 users
const a = 7; console.log("0000".substr(a.toString(2).length) + a.toString(2)); const b = 56; const binary = b.toString(2); console.log("00000000".substr(binary.length) + binary); /* run: 0111 00111000 */