How to convert Number to Boolean in JavaScript?

HTMLJavascriptProgramming Scripts

You can try to run the following to learn how to convert Number to Boolean in JavaScript −

Example

Live Demo

<!DOCTYPE html>
<html>
   <body>
      <p>Convert Number to Boolean</p>
      <script>
         var myNumber = 1;
         document.write("Boolean : " + Boolean(myNumber));
      </script>
   </body>
</html>
raja
Published on 26-Feb-2018 12:39:59
Advertisements