JavaScript 数组连接 join 方法


JavaScript 数组连接 join 方法

<html>
   <head>
      <title>JavaScript Array join Method</title>
   </head>

   <body>

      <script type = "text/javascript">
         var arr = new Array("First","Second","Third");

         var str = arr.join();
         document.write("str : " + str );

         var str = arr.join(", ");
         document.write("<br />str : " + str );

         var str = arr.join(" + ");
         document.write("<br />str : " + str );
      </script>

   </body>
</html>