To resolve this task you have to use closure - immediately invoke function witch be called on every iteration with i
as param, and setTimeout inside this function. In this case param you passed will be stored in scope and could be used in timeout callback:
for (var i=0; i<8; i++) (function(t) {
window.setTimeout(function() {
//do anything with t
}, t*2000)
}(i))
UPD
Also here is a shorten ES6 version. As let
has block scope you can get rid os wrap function closure use
for (let i=0; i<8; i++){
setTimeout(() => {
console.log(i)
}, 2000 * i);
}