title: How to initialize (declare) an array in TypeScript?
body: <p>I am absolute beginner on TypeScript. I want to initialize an array of numbers in TypeScript by "for" loop as you see in the following:</p>
  
  <pre><code> public hours: number[];
   constructor() {
     for (let i: number = 1; i &lt; 25; i++) {
        this.hours[i] = i;
      }
    }
  </code></pre>
  
  <p>I get an error: Cannot set property '1' of undefined.
  Could you please help me?</p>