Loops & Enumerations
Last updated
What is Loops & Enumerations?
Loops in Ruby allow you to execute a block of code repeatedly. Enumerations, on the other hand, are methods that iterate over collections like arrays and hashes, applying a block of code to each element. Both loops and enumerations provide ways to process data and perform actions multiple times, but enumerations are often preferred for their conciseness and readability when working with collections.
Free resources to learn Loops & Enumerations
- ArticleLoops and Iterators
- ArticleLoops
- ArticleRuby Loops: Repeating Something Many Times
- ArticleRuby - Loops
More in stage 11: Loops & Enumerations
Loops & Enumerations: common questions
Can I learn Loops & Enumerations in Hindi?
This lesson is written in English. Once you sign in, open it in the interactive course and ask the AI tutor to explain Loops & Enumerations in Hindi or Hinglish. The tutor answers from this lesson’s own text, so it stays on the syllabus, and it runs on your own Google, OpenAI or Anthropic key.
Is this Loops & Enumerations tutorial for beginners?
It is lesson 30 of 102 in the free Ruby roadmap, in stage 11, Loops & Enumerations. If you are new to Ruby, start from stage 1 and come back here in order; if you already know the earlier stages, this lesson stands on its own.