text: Q:
  
  Looping through a JSON Array in JavaScript
  
  Okay so I'm given a large JSON Object from a GET request and it looks like this:
  {
      "partners": [
          {
              "firstName": "Mai",
              "lastName": "Dost",
              "email": "mdost@hubspotpartners.com",
              "country": "United States",
              "availableDates": [
                  "2017-05-29",
                  "2017-05-31",
                  "2017-06-01",
                  "2017-06-07",
                  "2017-06-08",
                  "2017-06-09",
                  "2017-06-11",
                  "2017-06-12"
              ]
          },
          {
              "firstName": "Annamae",
              "lastName": "Monty",
              "email": "amonty@hubspotpartners.com",
              "country": "United States",
              "availableDates": [
                  "2017-05-31",
                  "2017-06-01",
                  "2017-06-07",
                  "2017-06-08",
                  "2017-06-09",
                  "2017-06-11",
                  "2017-06-12",
                  "2017-06-15",
                  "2017-06-16",
                  "2017-06-20"
              ]
          },
  
  I'm trying to scan through all the individual partners in this object but I can't seem to get anything returned other than "undefined". I'm using a for loop to try go into each value and I've asked it to alert me each time so I can see it's contents. Can you guys see what I'm doing wrong? 
  The JavaScript code for this is:
  $.getJSON("someURL_IcantDisclose", function (result) {
    var data = JSON.stringify(result, null, 2);
    document.getElementById('load').innerHTML = data;
    for(var i=0; i<data.partners.length;i++){
      alert(data.partners[i]);
    }
  });
  
  A:
  
  You are attempting to loop over the strinigified version of the result - $.getJSON will return the parsed JSON so you can use result directly:
  $.getJSON("someURL_IcantDisclose", function (result) {
    for(var i=0; i< result.partners.length; i++){
      alert(result.partners[i]);
    }
  });
  
  A:
  
  Not sure what these two lines are doing var data = JSON.stringify(result, null, 2);document.getElementById('load').innerHTML = data;, but the following snippet will allow you to loop over the partners
  $.getJSON("someURL_IcantDisclose", function (result) {
    for(var i=0; i<result.partners.length; i++){
      alert(result.partners[i]);
    }
  });
  
  