for( var i=0; i<7; i+=2 )
{
if( ++i==5 ) break;
else continue;
}
console.log( i++ );
What will be printed to the console?
Oh, it is a great improvement of the question, @docahrens! Cool, thanks)
2016 Jun 15, 7:22:27 PM
your explanation is too brief. you should show how it ended up as 9 by going through the order of increments. question would probably be better is it did not come out to 9, because many would guess the right answer by accident assuming that because 9 was the limit of the for loop (which your explanation seems to imply), but it is only a coincidence that the increments totaled to 9. If you change the limit to 7 like so: for(var i=0; i<7; i+=2 ), the question would be better, because they if they guess it is the limit they would be wrong, it is still 9.
2016 Jun 12, 2:31:20 PM
Ввійдіть щоб вподобати
Ввійдіть щоб прокоментувати