Use until and array element to loop through an array : Array Index « Array « Ruby
- Ruby
- Array
- Array Index
Use until and array element to loop through an array
array = ['cherry', 'strawberry', 'orange']
index = 0
until index == array.length
puts "At position #{index}: #{array[index]}"
index += 1
end
Related examples in the same category