mirror of
https://github.com/kamranahmedse/developer-roadmap.git
synced 2026-11-29 02:17:42 +08:00
* refactor: clean to roadmap content * refactor: move shared helpers into scripts/lib
9 lines
833 B
Markdown
9 lines
833 B
Markdown
# Next Keyword in Loops
|
|
|
|
The `next` keyword in Ruby provides a way to skip the current iteration of a loop and proceed directly to the next iteration. When `next` is encountered within a loop (like `for`, `while`, `until`, or iterators like `each`), the remaining code in the current loop cycle is bypassed, and the loop immediately begins its next cycle, if one exists. This is useful for skipping certain elements or conditions within a collection or range.
|
|
|
|
Visit the following resources to learn more:
|
|
|
|
- [@article@Controlling Loop Execution](https://launchschool.com/books/ruby/read/loops_iterators#controllloop)
|
|
- [@article@Ruby Explained: Iteration](https://eriktrautman.com/posts/ruby-explained-iteration)
|
|
- [@article@Understanding The Ruby Next & Break Keywords](https://www.rubyguides.com/2019/09/ruby-next-break-keywords/) |