Sirko answered the question in a comment but question shows up as 0 answers in the list so I'll add it as answer.
You set the variable but you never use it (read it). Try the following:
while (i < target) {
current = i;
console.log(current);
}