This commit is contained in:
Asger F 2018-12-19 10:10:56 +00:00
Родитель f57454951b
Коммит f9d7f8ba11
1 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -38,7 +38,7 @@ Determine what the loop is supposed to do:
In this example, a function is intended to remove "<code>..</code>" parts from a path:
</p>
<sample src="examples/MisleadingIndentationAfterControlStmt.js" />
<sample src="examples/MissingIndexAdjustmentAfterConcurrentModification.js" />
<p>
However, whenever the input contain two "<code>..</code>" parts right after one another, only the first will be removed.
@ -51,13 +51,13 @@ index 0 and will therefore be skipped.
One way to avoid this is to decrement the loop counter after removing an element from the array:
</p>
<sample src="examples/MisleadingIndentationAfterControlStmtGood.js" />
<sample src="examples/MissingIndexAdjustmentAfterConcurrentModificationGood.js" />
<p>
Alternatively, use the <code>filter</code> method:
</p>
<sample src="examples/MisleadingIndentationAfterControlStmtGoodFilter.js" />
<sample src="examples/MissingIndexAdjustmentAfterConcurrentModificationGoodFilter.js" />
</example>
<references>