JS: Convert Decimal, Binary
Decimal to Binary
(15).toString(2).toUpperCase() === "1111"
Binary to Decimal
// direct binary input 0b1111 === 15 // convert binary to decimal parseInt("1111", 2 === 15)
〔see Number.parseInt〕
(15).toString(2).toUpperCase() === "1111"
// direct binary input 0b1111 === 15 // convert binary to decimal parseInt("1111", 2 === 15)
〔see Number.parseInt〕