While loop



Why does the while loop print ‘18’?

for (i=0; i<=15; i+=3) {//this is a counter which increments by +3

var i = 0;
while (i<=15) {


It is the Javascript interpreter which is running in this course-environment,
it display’s the last non-displayed action…

You will also encounter this, when you are doing a return-statement
as last action…
You could counter this by using a
console.log( " " ); as last statement…

In some sections of this course, the course-checker Display’s data
this you could then identify by placing two EXTRA code-line’s:
console.log( “== My End ==” );
console.log( “== All that is displayed now, is the course-checker ==” );


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