JavaScript 数组 unshift 方法


JavaScript 数组 unshift 方法

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

   <body>

      <script type = "text/javascript">
         var arr = new Array("orange", "mango", "banana", "sugar");

         var length = arr.unshift("water");
         document.write("Returned array is : " + arr );
         document.write("<br /> Length of the array is : " + length );
      </script>

   </body>
</html>