How to convert int to binary in Node.js

1 Answer

0 votes
const a = 23;
let binary = a.toString(2);
           
console.log(binary);
 
const b = 9863;
binary = b.toString(2);

console.log(binary);




/*
run:

10111
10011010000111

*/

 



answered Nov 25, 2023 by avibootz

Related questions

1 answer 135 views
1 answer 193 views
1 answer 129 views
1 answer 107 views
1 answer 139 views
...