++++ why second display of last Item+++++++++++++++++++++++++++++-1It 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-statementas last action...You could counter this by using a console.log( " " ); as last statement....-2In some sections of this course, the course-checker Display's datathis you could then identify by placing to EXTRA code-line's:console.log( "== My End ==" );console.log( "== All that is displayed now, is the course-checker ==" );

Thanks for that clarity, interesting. Thought it might have been something deeper that I didn't understand yet, since the last items typed had printed in a few exercises right before this one, even though no console.log's were used.

It's actually the SCT (Submission Correctness Test) that is causing the second print out, not the interpreter, though what @leonhard_wettengmx_n explains is also true in cases where the last executed statement is NOT a console.log()..

Remember, we are in the console environment which is a terminal and command line with a JavaScript interpreter/compiler, but no document tree. The natural behavior of a terminal is to respond to all commands, even if the response is undefined. Response can take three basic forms:

as descibed by Leon, above; (log() is not last command)

as described by me, above; (log() is last command)

undefined (last command in a function with no return value [ return is implicit ])

Getting around the SCT is pointless, but we can see what the SCT is doing (in some cases) by turning off all generated output and running the code. Then creep it in and test as you go. When double output appears, we have a good indication of how the lesson checker is looking at our work.

There are a lot a different ways for the SCT to check lessons. The various authors who worked independently all chose their own approach, which adds to the dimensionality. It is a broad spectrum.

Essentially, we can break it down to three types of tests, each of which may have their own sub-test.

Code typed into the editor. The SCT can see this and do string or pattern matches.

Output printed to the display. The SCT can read the screen of the terminal and do string or pattern matches.

Return values from executed functions. The SCT will call the function with an argument of the author's choosing and examine the return value.

By knowing this, we can play with our code to get a read on the SCT. It's purely for fun, mind. Not to prove anything.