How to convert Decimal to Binary in JavaScript?

HTMLJavascriptProgramming Scripts

To convert Decimal to Binary in JavaScript, you can try to run the following code.

Example

<!DOCTYPE html>
<html>
   <body>
      <script>
         document.write("Decimal to Binary<br>");
         document.write((-7 >>> 0).toString(2));
      </script>
   </body>
</html>
raja
Published on 26-Feb-2018 10:16:41
Advertisements