title: javascript check for valid json
body: <p>I have this if statement looking for a json object:</p>
  
  <pre><code>updateStudentData = function(addUpdateData) {
      var rowDataToSave;
  
      if(addUpdateData.data.row) {
          rowDataToSave = addUpdateData.data.row;
      } else {
          rowDataToSave = addUpdateData.data;
      }
  }
  </code></pre>
  
  <p>Can anyone please tell me how I can check to see if the json has a row object?  Currently I get cannot read row property of undefined.</p>