Skip to content

Instantly share code, notes, and snippets.

@rexcfnghk
Last active July 1, 2016 14:52
Show Gist options
  • Select an option

  • Save rexcfnghk/b64e58971f0735d7c5ade7ac2e082d26 to your computer and use it in GitHub Desktop.

Select an option

Save rexcfnghk/b64e58971f0735d7c5ade7ac2e082d26 to your computer and use it in GitHub Desktop.
const http = require('http');
var i = 0,
urls = [ 'http://www.google.com', 'http://www.yahoo.com' ],
urlLength = urls.length;
for (; i < urlLength; i++) {
var innerI = i;
http.get(urls[i], function() { console.log('i: ' + innerI); });
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment