Declaring Array by Array Literal



Write a JavaScript code to demonstrate Array Literal

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

        var a =[1,2,3,4,5];
        document.write("Length of Array =" + a.length);

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

Output:

Length of Array =5