title: Complex JSON nesting of objects and arrays
body: <p>I am having difficultly with syntax and structure of JSON objects/arrays.</p>
  
  <pre><code>{ 
    "accounting" : [   
                       { "firstName" : "John",  
                         "lastName"  : "Doe",
                         "age"       : 23 },
  
                       { "firstName" : "Mary",  
                         "lastName"  : "Smith",
                          "age"      : 32 }
                   ],                            
    "sales"      : [ 
                       { "firstName" : "Sally", 
                         "lastName"  : "Green",
                          "age"      : 27 },
  
                       { "firstName" : "Jim",   
                         "lastName"  : "Galley",
                         "age"       : 41 }
                   ] 
  } 
  </code></pre>
  
  <p>I want to make a nested structure of objects and arrays that would house the following info:</p>
  
  <pre><code>{
  "problems": [{
      "Diabetes":[{
          "medications":[{
              "medicationsClasses":[{
                  "className":[{
                      "associatedDrug":[{
                          "name":"asprin",
                          "dose":"",
                          "strength":"500 mg"
                      }],
                      "associatedDrug#2":[{
                          "name":"somethingElse",
                          "dose":"",
                          "strength":"500 mg"
                      }]
                  }],
                  "className2":[{
                      "associatedDrug":[{
                          "name":"asprin",
                          "dose":"",
                          "strength":"500 mg"
                      }],
                      "associatedDrug#2":[{
                          "name":"somethingElse",
                          "dose":"",
                          "strength":"500 mg"
                      }]
                  }]
              }]
          }],
          "labs":[{
              "missing_field": "missing_value"
          }]
      }],
      "Asthma":[{}]
  }]}
  </code></pre>
  
  <p>But I have no idea what the right way to do this should be.  Should I just be making JavaScript objects?  Does JSON make sense for this project?</p>
  
  <p>What is the correct syntax to set something like this up?</p>
  
  <p>Here is my code so far:</p>
  
  <pre><code>$(document).ready(function() {
      $.getJSON('js/orders.json', function(json) {
        $.each(json.problems, function(index, order) {
          $('.loadMeds').append('&lt;p&gt;' + order.name + '&lt;/p&gt;')
        });
      });
  });
  </code></pre>