Fix ruby for-loops examples (#30309)
* Fix ruby for-loops examples * Fix alignment * fix: corrected array.each do syntax * fix: corrected array.each do syntax * fix: correct array.each do syntax * fix: corrected array.each do syntax * fix: correct array.each do syntax * fix: correct array.each do syntax
This commit is contained in:
committed by
Randell Dawson
parent
c606946c5c
commit
0191cb2eb4
@@ -17,7 +17,7 @@ end
|
||||
There are many many different ways in which you can execute a for loop or loop in Ruby, another such example would be:
|
||||
|
||||
```
|
||||
element.each do |element|
|
||||
array.each do |element|
|
||||
puts element
|
||||
end
|
||||
```
|
||||
@@ -27,5 +27,5 @@ This would achieve exactly the same results as the aforementioned for loop, it i
|
||||
To go one step further, we can write the above loop in the following way:
|
||||
|
||||
```
|
||||
element.each do { |element| puts element }
|
||||
array.each do |element| puts element end
|
||||
```
|
||||
|
Reference in New Issue
Block a user