The continue statement skips the rest of the loop and jumps back to the beginning of the loop. For example, we can create a loop that loops forever using while(true) and use the break statement to break inside the loop instead by checking that a certain condition was met. The break statement allows to stop the execution of a loop. Let's see an example: var i Ĭonsole.log(i + " bottles of beer on the wall") It is mainly used for iterating over arrays or objects. JavaScript has two methods for running the same code several times.
0 Comments
Leave a Reply. |