SyntaxFix
Write A Post
Hire A Developer
Questions
This is how I manage to handle it:
const decbin = nbr => { if(nbr < 0){ nbr = 0xFFFFFFFF + nbr + 1 } return parseInt(nbr, 10).toString(2) };
got it from this link: https://locutus.io/php/math/decbin/