Break and Continue Statement

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

Usage of break in a switch:

1. Exit out of the switch block. This will stop the execution of more execution of code and/or case testing inside the block.

Usage of break in a loop:

1. Exit the loop and continues executing the code after the loop (if any).

What is continue statement?

1. It stops the current iteration and forces the loop to start a new one (if the condition allows). 2. Terminates execution of the statements in the current iteration of the current or labeled loop, and continues execution of the loop with the next iteration.

What is break statement?

1. Terminates the current loop, switch, or label statement and transfers program control to the statement following the terminated statement.

Usage of continue in a while loop:

It jumps back to the condition.

Usage of continue in a for loop:

It jumps to the update expression.

Usage of break in a label (optional):

To "jump out" of any JavaScript code block


Set pelajaran terkait

Prep U:40: Fluid, Electrolyte, and Acid-Base Balance

View Set

Master Set Leadership Final (all content)

View Set

Lecture 1 "Audience Response" Questions

View Set

Chapter 37 (Cardiovascular/Hematologic Disorders)

View Set

PADI Open Water DIve Course Summary

View Set