for (var i=1; i<=100; i++){
  (function(index){
    setTimeout(function(){
      console.log("index: "+index);
    },i * 10);
  })(i);
}