title: ReactJs: How to handle empty array with map function inside render method
body: <p>I m trying to print table with some JSON data, but I am not able to render empty array when I am using map method.</p>
  
  <p>JSON DATA : </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>    [{
   "id": 6,
   "firstname": "Sharon",
   "lastname": "Jenkins",
   "specialties": []
  }, {
   "id": 2,
   "firstname": "Helen",
   "lastname": "Leary",
   "specialties": [{
    "id": 1,
    "name": "radiology"
   }]
  }, {
   "id": 4,
   "firstname": "Rafael",
   "lastname": "Ortega",
   "specialties": [{
    "id": 2,
    "name": "surgery"
   }]
  }, {
   "id": 5,
   "firstname": "Henry",
   "lastname": "Stevens",
   "specialties": [{
    "id": 1,
    "name": "radiology"
   }]
  }]</code></pre>
  </div>
  </div>
  </p>
  
  <p>My Code :</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code> {this.state.vets.map(vet =&gt;&lt;tr&gt;&lt;td&gt;{vet.firstname}&lt;/td&gt;
                    {  
                                    
                    vet.specialties.map((subitem,i) =&gt; {
                         
                      return &lt;td&gt;{subitem.name}&lt;/td&gt; })}&lt;td&gt;EDIT&lt;/td&gt;&lt;td id={vet.firstname}&gt;&lt;div class="funkyradio"&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Now I am getting the following error
  <a href="https://i.stack.imgur.com/BdyW6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BdyW6.png" alt="enter image description here"></a></p>
  
  <p>As Sharon doesn't have a specialist, I need to print as N/A.</p>
  
  <p>How can I check the specialities are empty and print N/A.</p>