Why the result of the following 2 code snippets produces different result?

const ages = [12, 15, 34, 56, 23, 11, 29, 8, 9, 18, 20, 22];
let fill = [];

for (var i = 0; i < ages.length; i++) {
    if (ages[i] >= 21) {
        fill.push(ages[i]);
        console.log(fill);
    }
}

If I console.log in the nested if it produces result not like if I console.log in for loop's code block? Can any one tell the reason?

const ages = [12, 15, 34, 56, 23, 11, 29, 8, 9, 18, 20, 22];
let fill = [];

for (var i = 0; i < ages.length; i++) {
    if (ages[i] >= 21) {
        fill.push(ages[i]);
    }
    console.log(fill);
}