JavaScript Loop Control (break & continue)

  1.  break: it will break the on going loop and exit.
  2. continue: once encounter continue, it will skip the remaining code block and continue running loop.

Example:

output: banana

in above code , continue during apple will get skipped and loop will break once encounter orange.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top