title: Looping through json data in express.js
body: <p>Im trying to loop through a json file and pick out every episode, but I'm confused that my loop only output the first <code>current_episode</code>, much appreciated if anyone can check my problem!</p>
  
  <pre><code>app.get('/episodes', function(req, res){
      fs.readFile('channels.json', 'utf8', function (err, data) {
          var jsondata = JSON.parse(data);
          for (var i=0; i&lt;jsondata.channels.length; i++){
              var myChannel = jsondata.channels[i].current_episode;
              res.send(myChannel);
          }
      })
  }); 
  </code></pre>
  
  <p>My json data:</p>
  
  <pre><code>{
    "total": 70,
    "request_uri": "\/channels\/",
    "channels": [
      {
        "channel_id": 42,
        "current_episode": [
          {
            "id": 126248,
            "title": "Spanarna",
          }
        ]
      },
      {
        "channel_id": 43,
        "current_episode": [
          {
            "id": 126255,
            "title": "Beck: I stormens \u00f6ga",
          }
        ]
      },
  ............
  }
  </code></pre>