title: for loop in node.js returns same value every time
body: <p>I've been trying to get this working, but I don't seem to understand why it doesn't output the right info.
  what I get in the console is "page: 6" 5 times, but what I want is page 1, page 2, page 3, page 4, page 5.</p>
  
  <pre><code>for (var i = 1; i &lt;= 5; i++) {
      lib.request({
          path: '/channels/staffpicks/videos',
          query: {
              page: i,
              per_page: 50
          }
      }, function (error, body, status_code, headers) {
          if (error) {
              console.log('error');
              console.log(error);
          } else {
              var totalbody = body.total;
              console.log('page: ' + i);
          }
      });
  }
  </code></pre>