Programming MisconceptionsHomeMisconceptionsConceptsLanguagesTextbooksContributorsAbout
HomeConcepts
Loop

Loop

A loop is a compound statement that repeats the statements in its body zero or more times.

Related concepts:  StatementRepetitionControl Flow

Closest Wikipedia entry:  Control flow: Loops

Misconceptions about Loop
12 documented Misconceptions

Any LanguageJavaJavaScriptPythonScratch
Check Yourself
Misconception
ForEachIteratesOverIndices
An enhanced for loop iterates over the indices of an array or a collection
Misconception
ForEachTraversesRecursiveStructure
For-each loops know how to traverse any recursive data structure
Misconception
ForEachVariableIsElement
One can assign to the variable of an enhanced for statement to store a value in the corresponding array or collection element
Misconception
ForIsConditional
The body of a for statement executes at most once
Misconception
ForVariableScopeBeyondLoop
The scope of variables declared in a for loop header extends beyond the loop
Misconception
IfIsLoop
The body of an if statement executes repeatedly, as long as the condition holds
Misconception
LoopBodyScopeImpliesLoopLifetime
Lifetime of variables declared in a loop body extends across all loop iterations
Misconception
LoopTerminatingCondition
For and while loops end when the condition becomes true
Misconception
PreIncrementBeforeLoop
Pre-increment in update part of for loop means increment before loop body

Find Misconceptions by...

Concept
Programming Language
Notional Machine
Textbook

About

About This Site
Structure and Content of the Inventory
Contributors