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 226 views
1 answer 242 views
1 answer 198 views
1 answer 228 views
1 answer 236 views
...