Guess the output of this JS code

Shuvo - Oct 19 '21 - - Dev Community

Try to guess the output of this code without running it. Let me know in the comment what you got 😉

let num = 10;
for(let i = 0; i < num; i++){
    console.log(num);
    num--;
}
Enter fullscreen mode Exit fullscreen mode

hint: You may have got the first half right

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .