title: Declaring array of objects
body: <p>I have a variable which is an array and I want every element of the array to act as an object by default. To achieve this, I can do something like this in my code.</p>
  
  <pre><code>var sample = new Array();
  sample[0] = new Object();
  sample[1] = new Object();
  </code></pre>
  
  <p>This works fine, but I don't want to mention any index number. I want all elements of my array to be an object. How do I declare or initialize it?</p>
  
  <pre><code>var sample = new Array();
  sample[] = new Object();
  </code></pre>
  
  <p>I tried the above code but it doesn't work. How do I initialize an array of objects without using an index number?</p>