title: Typescript: Accessing the properties of a key value pair in typescript
body: <p>I have a key value pair object in typescript. </p>
  
  <p><code>const data = {INTERNAL:[372042],EXTERNAL:[332244]};</code></p>
  
  <p>The above is not a map, but I want to iterate over its keys and use it in a switch case pattern.</p>
  
  <pre><code>mapData(data: { key: string; value: Array&lt;number&gt; }):void{
  switch(data[key]) {
  case 'INTERNAL':
        console.log('this is Internal data' =+data[value];
  break;
   case 'EXTERNAL':
        console.log('this is External data' =+data[value];
  break;
  default:
    }
  }
  </code></pre>
  
  <p><code>data[key]</code> or <code>data[value]</code> is throwing an error saying <code>key/value is not existing'.</code></p>
  
  <p>What is the correct way to access the data.</p>