title: how to nested data from inside a JSON
body: <pre><code>const data = [{
    &quot;detectedLanguage&quot;: {
      &quot;language&quot;: &quot;hi&quot;,
      &quot;score&quot;: 1
    },
    &quot;translations&quot;: [{
      &quot;text&quot;: &quot;long steff&quot;,
      &quot;to&quot;: &quot;en&quot;
    }]
  }]
  </code></pre>
  <p>How do I console.log only the <code>translation.text</code> field?</p>
  <p>I tried <code>console.log(JSON.stringify(res.data.translation.text)</code> but that gives me the following error:</p>
  <blockquote>
  <p>TypeError: Cannot read property 'text' of undefined</p>
  </blockquote>