Ruby - Basics and Runtime
What will be the output when you enter this in IRB?
5.times { |i| puts i }5.times { |i| puts i }times methodtimes method runs the block 5 times, with i from 0 to 4.puts i does inside the blocki on a new line, so output is 0,1,2,3,4 each on separate lines.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions