How to print the bits of an integer in 32 bit format with Node.js

1 Answer

0 votes
const num = 12986142;
 
console.log(("00000000000000000000000000000000" + num.toString(2)).substr(-32));
 
 
 
 
/*
run:
 
00000000110001100010011100011110
 
*/
 

 



answered Jan 12, 2023 by avibootz

Related questions

1 answer 105 views
1 answer 122 views
1 answer 113 views
1 answer 133 views
2 answers 252 views
...