JavaScript 数字toString函数


JavaScript 数字toString函数

<html>
   <head>
      <title>JavaScript toString() Method </title>
   </head>

   <body>

      <script type = "text/javascript">
         num = new Number(15);
         document.write("num.toString() is " + num.toString());
         document.write("<br />");

         document.write("num.toString(2) is " + num.toString(2));
         document.write("<br />");

         document.write("num.toString(4) is " + num.toString(4));
         document.write("<br />");
      </script>

   </body>
</html>