Ways to declare an array - Javascript Array

Javascript examples for Array:constructor

Description

Ways to declare an array

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript">
    window.onload=( function() {// w w w  .jav  a 2  s .com
(function () {
    "use strict";
    var foo,
        bar;
    function Array() {
        console.log('foo');
    }
    foo = new Array();
    bar = [];
}());
    });

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

Related Tutorials