Break and Continue

¡Supera tus tareas y exámenes ahora con Quizwiz!

break;

The break statement "jumps out" of a loop and continues executing the code after the loop

continue;

The continue statement breaks only one iteration in the loop, and continues with the next iteration.

continue example

for (i = 0; i <= 10; i++) { if (i==5) { continue; } document.write(i + "<br/>"); }

Break example

for (i = 0; i<=10; i++){ if (i ==5) { break; } document.write(i + "<br/>"); }


Conjuntos de estudio relacionados

CPS 340 Project Management Test 1 (Quiz 1 - Quiz 5)

View Set

Unit 1 Quiz- The Experience Economy

View Set

Bio Exam4 (27, 52, 53, 54, 55, 56) [tbd]

View Set

Marketing Study Questions, ch 13, Chapter 11, Marketing 351 Ole Miss Cousley Chapters 13 (Shuffle to avoid repeating of the same topics), chp 6 mktg, chp 6 mktg, Marketing Ch.6, Marketing Chapter 8, MKTG test 2 ch 6, MKTG ch 3, Marketing 351 Chapter...

View Set

Milday Chapter 11: Properties of the Hair and Scalp Workbook

View Set

ANTH 1: Physical Anthropology: Final (All info)

View Set