Declaring Array by Creating Instance of Array



Write a JavaScript code to create an Array and print its length.

<html>
  <head>
    <title>Array Demo</title>
      <script>

        var a =new Array(3);
        document.write("Length of Array =" + a.length);

      </script>
    </head>
  <body>       
</body>
</html>

Output:

Length of Array =3