title: Populate list using a for loop
body: <p>I have an array with properties that i want to transfer to a list using a <code>for loop</code>.</p>
  
  <pre><code>for (int i = 0; i &lt; data.cars.Count; i++)
  {
      var model = data.cars[i].model.ToString();
      cars = new List&lt;Car&gt;
      {
          new Car { Model = model }
      };
  }
  </code></pre>
  
  <p>Keep getting a <code>System.ArgumentOutOfRangeException:Index was out of range</code> exception. Not sure how to insert each model name in a new <code>Car</code> instance using a <code>for loop</code>.</p>
  
  <p>EDIT:
  <code>data.Count</code> was a typo, the same exception was thrown while using <code>data.cars.Count</code>. To clarify, the length of <code>data.cars.Count</code> is 20 objects containing a <code>model</code> property.</p>