For Loop iteration position, have different output
What's the difference of the 2 code ---------------code 1------------------- var countOfRooms = 15; // Your code here for (var hotelFloor = 0; hotelFloor <= countOfRooms;){ hotelFloor++; if (hotelFloor == 13){ continue; } console.log(hotelFloor); } ----------code 2-------------- var countOfRooms = 15; // Your code here for (var hotelFloor = 0; hotelFloor <= countOfRooms;){ if (hotelFloor == 13){ continue; } hotelFloor++; console.log(hotelFloor); } For me, They're same, because the if statement inside for loop is considered false and will be skip, unless it's true. But why code 1 is from 1-16(13 not included). While code 2 is infinite. Or near, don't actually know if it's finite or infinite, I use mobile app, but it says execution time out.