In JavaScript, a simple for loop (like the one in your function) is synchronous. This means each iteration of the loop runs to completion before moving on to the next one, and the function doesn't reach the return statement until the loop has finished all its iterations. Why do you think it is returning before ending the for loop?