title: Mapping a text response in javascript
body: <p>Initializing the state</p>
  <pre><code>this.state = {
  apiResponse : []
  }
  </code></pre>
  <p>setting the state to response from api inside componentDidmount</p>
  <pre><code>this.setState({
   apiResponse: response
  })
  </code></pre>
  <p>&quot;response&quot; looks like</p>
  <pre><code>{polyinfo: &quot;{&quot;name&quot;: &quot;hello1&quot;}&quot;}
  {polyinfo: &quot;{&quot;name&quot;: &quot;hello2&quot;}&quot;}
  </code></pre>
  <p>I need to get the value of name</p>
  <p>Things i tried</p>
  <pre><code>list = () =&gt; {
  
  const polyInfo = JSON.parse(this.state.apiResponseJson);
  return polyInfo.map(element =&gt; {
  console.log(element.name);
    // console.log(element.polyinfo.name);
  });
  </code></pre>
  <p>};</p>