title: Check JSON data element value and return "" if Null for a multidimensional non-symmetrical JSON structure
body: <p>I have an external data source that sometimes returns a value of null, i do not have access to this data source so i cannot change it. My Angular 2 app crashes on a undefined or null value when trying to display the data. I am trying to create a function that catches null or undefined values and sets them to an empty string. </p>
  
  <p>I have found examples for symmetrical JSON structures, but not non-symmetrical nested loop structures </p>
  
  <pre><code>// JSON ARRAY EXAMPLE 
  [
   {
    "a":"1",
    "x":null,
    "y":[
         {"k": "3"},
         {"i": "5"}
     ]
   },
   {
    "a":"1",
    "x":"2",
    "y":[
         {"k": "3"},
         {"i": "5"},
         {"z": "4"},
         {"p": null}
     ]
   },
   {
    "a":null,
    "x":"2"
   }
  ]
  </code></pre>
  
  <p>Current checking function not working </p>
  
  <pre><code>//Checking passes in JSON array
  checkData(dataSet) {
    dataSet.forEach(function(obj) {
      console.log("checking data");
       if(!obj || obj === null){
         return "";
       }
       else{
         return obj;
       }
    });
  }
  </code></pre>