Initializing an Array



Write a JavaScript code to create and Initialize an element in Array.

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

        var a =new Array("C","C++","Java","VB");
        document.write("Length of Array =" + a.length);

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

Output:

Length of Array =4