title: Iterating through JSON file
body: <p>I am trying to read schedule data from a JSON file called <code>js/schedule.json</code> which looks like:</p>
  
  <pre><code>[
  {"date":"12/06/2014","day":"Thursday","kick-off":"21:00","team1":"Brazil","team2":"Croatia","group":"A","stage":"group stages","broadcaster":"ITV"},
  {"date":"13/06/2014","day":"Friday","kick-off":"17:00","team1":"Mexico","team2":"Cameroon","group":"A","stage":"group stages","broadcaster":"ITV"}
  
  ...    
  ]
  </code></pre>
  
  <p>I want to iterate through each item in the JSON object and only return the match fixture where the "date" matches a previously set variable called: <code>today</code>. </p>
  
  <p>The jQuery I'm using is the following:</p>
  
  <pre><code>function getArray(){
      return $.getJSON('js/schedule.json');
  }
  
  getArray().done( function(json) {
      console.log(json); // show the json data in console
      var _len = json.length;
      var fixture;
  
  
      //loop through json and match today's date with match-date
      for (var i in json) {
          fixture = json[i];
          if (fixture.date == today) {
              //print out today's schedule here
              console.log(fixture.team1 + " Vs. " + fixture.team2);
          }
      }
  
  });
  </code></pre>
  
  <p>However, what I get as an output in the Console is 
  <code>[Object, Object, Object, Object, Object, Object, Object]</code>,  there are 7 items in the object so this is the correct amount for the time being, however I can't get the console to show the <code>fixture.team1 + fixture.team2</code></p>
  
  <p>I've checked various posts which have similar problems such as <a href="https://stackoverflow.com/questions/13456610/json-returning-object-object">JSON returning [object Object]</a> but these don't quite fix it.</p>
  
  <p>Any help would be fantastic. Cheers!</p>
  
  <p><strong>As pointed out the problem here was with the value of <code>today</code> not matching the value in the <code>date</code>. After adding a preceding "0" to months/days &lt; 10 the code worked.</strong></p>