title: How to loop through the following object in Javascript?
body: <p>I have been having some trouble implanting a way to loop through this object that returns this:</p>
  
  <pre><code>{ 
    matches: [ 
      { 
        region: 'OCE',
        platformId: 'OC1',
        matchId: 122934310,
        champion: 36,
        queue: 'TEAM_BUILDER_DRAFT_RANKED_5x5',
        season: 'SEASON2016',
        timestamp: 1456100362493,
        lane: 'BOTTOM',
        role: 'DUO_SUPPORT' 
      },
      { 
        region: 'OCE',
        platformId: 'OC1',
        matchId: 122510663,
        champion: 44,
        queue: 'TEAM_BUILDER_DRAFT_RANKED_5x5',
        season: 'SEASON2016',
        timestamp: 1455751169038,
        lane: 'BOTTOM',
        role: 'DUO_SUPPORT' 
      } 
    ],
    startIndex: 0,
    endIndex: 2,
    totalGames: 135 
  }
  </code></pre>
  
  <p>I am a php developer so i would use a foreach in this case however I can't seem to figure it out for javascript. Thanks</p>
  
  <p>I need to iterate through each matchId</p>
  
  <p>current Code:</p>
  
  <pre><code>app.get('/summoner/:summonerName', function(req, res) {
  lolapi.Summoner.getByName(req.params.summonerName, function(err, obj) {
    var options = {
      beginIndex: 0,
      endIndex: 2
    };
    lolapi.MatchList.getBySummonerId(obj['savisaar2'].id, options,   function(err, matches) {
      for(var i = 0; i &lt; obj.matches.length; i++) { console.log(obj.matches[i].matchId); }
    });
  });
  });
  </code></pre>