Just trying to console log the correct index printed on each iteration not to sure why its not working.
(function() {
var index,
length = 10;
for (index = 0; index < this.length; index++) {
setTimeout(function() {
console.log(index);
}, 100);
}
})();