title: Typescript create array with loop dynamically
body: <p>Am creating a mock class, for generate example data for my Angular2 TypeScript project. Am still a beginner with programming, and struggle with the informatie that is available about TypeScript. My question:</p>
  
  <p>I want to create 100 items and save them in an array. The 100 items will be generated dynamically. The static way i use is very simple, but how do I can do this dynamicly? I made a begin with some iteration code, but how can I best replace the console.log code, and let the output of the iteration be as the static data. I need some examples</p>
  
  <p><strong>mock-names.ts</strong> (Static)</p>
  
  <pre><code>export var NAMES: Name[] = [
      {"id": 01, "name": "Tony"},
      {"id": 02, "name": "Jake"}
  ]
  </code></pre>
  
  <p><strong>mock-names-dynamically.ts</strong> (Dynamically)</p>
  
  <pre><code>export var NAMES = [];
  
  for (let i = 1; i &lt; 100; i++) {
      console.log(i);
  }
  </code></pre>
  
  <p><strong>name.ts</strong> (Name Class file)</p>
  
  <pre><code>export class Name {
      id: number;
      name: string;
  }
  </code></pre>