title: Uncaught TypeError: Cannot read property 'map' of undefined on AJAX object
body: <p>Is there a way that I can pass in N/A as default if there is no results? I want to be able to define it as "N/A" if the mapped object is empty on Title.</p>
  
  <p>Some of the items under <code>Media_x0020_Specialist_x0028_s_x.results</code> return, but then some items are not returning and I'm getting that error.</p>
  
  <p>Code:</p>
  
  <pre><code>  $.ajax({
      url: requestUri,
      type: "GET",
      dataType: "json",
      cache: false,
      headers: {
        accept: "application/json; odata=verbose"
      },
      success: function success(data) {
        onSuccess(data);
        ExportTable();
      }
    });
  
    function onSuccess(data) {
      var item = data.d.results;
      for (var i = 0; i &lt; item.length; i++) {
        tableContent += "&lt;tr&gt;";
        tableContent +=
          "&lt;td&gt;" +
          item[i].Franchises_x0020_with_x0020_Shar.results
            .map(function(r) {
              return r.Title;
            })
            .join("; ") +
          "&lt;/td&gt;";
        tableContent +=
          "&lt;td&gt;" + item[i].Stand_x0020_Alone_x0020_Franchis + "&lt;/td&gt;";
        tableContent +=
          "&lt;td&gt;" +
          item[i].Franchise_x0020_Liason.results
            .map(function(r) {
              return r.Title;
            })
            .join("; ") +
          "&lt;/td&gt;";
  
  
        tableContent +=
          "&lt;td&gt;" +
          item[i].Media_x0020_Specialist_x0028_s_x.results
            .map(function(r) {
              return r.Title;
            })
            .join("; ") +
          "&lt;/td&gt;";
  
        tableContent += "&lt;/tr&gt;";
        tableContent += "&lt;/tbody&gt;&lt;/thead&gt;";
      }
      $("#title").append(tableContent);
    }
  </code></pre>
  
  <p>Here is the error:
  <a href="https://i.stack.imgur.com/CxNVP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CxNVP.png" alt="enter image description here"></a></p>