title: How to get json object using key in typescript?
body: <p>I am newbie in typescript so not really good in syntax.</p>
  <p>My requirement is I want to get some specific elment from json file in typescript.</p>
  <p>Following is piece of code that I am trying here.</p>
  <p>Json file</p>
  <pre><code>{
  &quot;Description&quot;: &quot;data&quot;,
  &quot;data_list&quot;: {
    &quot;example1&quot;: {
      &quot;description&quot;: &quot;example1&quot;,
      &quot;anothermap&quot;:{
         &quot;a&quot;: &quot;1&quot;,
         &quot;b&quot;: &quot;2&quot;
      }
   },
   &quot;example2&quot;: {
      &quot;description&quot;: &quot;example2&quot;
   }
  }
  </code></pre>
  <p>}</p>
  <p>Typescript file</p>
  <pre><code>import * as test from '../test.json';
  
  export class Demo extends cdk.Stage {
  
    constructor(scope: cdk.Construct, id: string, name: string) {
      super(scope, id);
  
      #const tskData = test.data_list['example1'];
      const tskData = test.data_list[name];
  }
  </code></pre>
  <p>in the above example when I try to call json value using literals then it works but not with varible. I can't use any literal here becuase what system needed will come as input.</p>
  <p>Following is the error that I am getting it</p>
  <pre><code>Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '
  </code></pre>
  <p>Any help on this would be appriciated</p>