Help while loop as for loop is strange


#1


https://www.codecademy.com/courses/javascript-beginner-en-qDwp0/0/3?curriculum_id=506324b3a7dffd00020bf661#

hi i'm new, i'm confused on while loop.
when i write i++ after console.log the console doesn't write the number 8, but if i write ì++ before console.log it's write number 8 inside console....why?


i=0
while(i<9)
{
    
    console.log("i like pizza");
    i++;
}

console write:
i like pizza
i like pizza
i like pizza
i like pizza
i like pizza
i like pizza
i like pizza
i like pizza
i like pizza
8


#2

isn't very important, it is console behavior, you can read more about it here, don't bother too much about it for the moment, that will come later


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.