Looping Logic

What is the output of the following code?

let answer = 0;

for(let i = 0; i < 10; i++) {
    answer += i;
}

console.log(answer);

45

Level: Apprentice · More JavaScript terms at this level

Updated