title: How to define Typescript Map of key value pair. where key is a number and value is an array of objects
body: <p>In my angular2 app i want to create a map which takes a number as key and returns an array of objects. I am currently implementing in following way but no luck. How should i implement it or should i use some other data structure for this purpose? I want to use map because maybe its fast?</p>
  
  <p><strong>Declaration</strong></p>
  
  <pre><code> private myarray : [{productId : number , price : number , discount : number}];
  
  priceListMap : Map&lt;number, [{productId : number , price : number , discount : number}]&gt; 
  = new Map&lt;number, [{productId : number , price : number , discount : number}]&gt;();
  </code></pre>
  
  <p><strong>Usage</strong></p>
  
  <pre><code>this.myarray.push({productId : 1 , price : 100 , discount : 10});
  this.myarray.push({productId : 2 , price : 200 , discount : 20});
  this.myarray.push({productId : 3 , price : 300 , discount : 30});
  this.priceListMap.set(1 , this.myarray);
  this.myarray = null;
  
  this.myarray.push({productId : 1 , price : 400 , discount : 10});
  this.myarray.push({productId : 2 , price : 500 , discount : 20});
  this.myarray.push({productId : 3 , price : 600 , discount : 30});
  this.priceListMap.set(2 , this.myarray);
  this.myarray = null;
  
  this.myarray.push({productId : 1 , price : 700 , discount : 10});
  this.myarray.push({productId : 2 , price : 800 , discount : 20});
  this.myarray.push({productId : 3 , price : 900 , discount : 30});
  this.priceListMap.set(3 , this.myarray);
  this.myarray = null;
  </code></pre>
  
  <p>I want to get an array of 3 objects if i use <code>this.priceList.get(1);</code></p>