Code Editor
Click here to navigate the course.
Drag the edges to resize the window.
In Projects, you can keep track of your progress as you go throught the tasks. Check each item as you complete it!
Cool, no? Now it's your turn to take the .each
method for a test drive.
numbers = [1, 2, 3, 4, 5]
# one way to loop
numbers.each { |item| puts item }
# another way to loop
numbers.each do |item|
puts item
end
numbers
. numbers
to the console.