title: How to create Array of custom object in Typescript
body: <pre><code>module NameSpacens{
      interface Serializable&lt;T&gt; {
          deserialize(input: Object): T;
      }
  
      export class Class1 implements Serializable&lt;Class1&gt;{
          private prop1: number;
          private prop2:string;
          constructor(va1?:number, va2?:string){
              this.prop1 = va1;
              this.prop2 = va2;
          }
  
          deserialize(jsonData){
              if (!(Array.isArray(jsonData))) {
                  this.Index = jsonData.index;
                  this.HeaderName = jsonData.headerName;
                  this.SortName = jsonData.sortName;
                  this.AllowSorting = jsonData.allowSorting;
                  return this;
              }
              else {
                  //How to code this portion to create list?
              }
          }
      }
  }
  
  var jsonDatas = [{ prop1: 1, prop2: "Test1"}, { prop1: 2, prop2: "Test2" }];
  
  var coll:Array&lt;NameSpacens.Class1&gt; = new NameSpacens.Class1().deserialize(jsonDatas);
  </code></pre>
  
  <p>for coll I am getting below error during compile time.</p>
  
  <p>Type 'Class1' is not assignable to type 'Class1[]'.
    Property 'length' is missing in type 'Class1'.    </p>
  
  <p>Also how I can create the list from JSON array of objects, in this case jsonDatas?</p>