For the ruby .times do is there a counter or do I have to do the following
count = 0
4.times开发者_如何学C do
puts "this is the count #{count}"
count = count+1
Yes, times
yields a counter:
4.times do |count|
puts "this is the count #{count}"
end
For the ruby .times do is there a counter or do I have to do the following
count = 0
4.times开发者_如何学C do
puts "this is the count #{count}"
count = count+1
Yes, times
yields a counter:
4.times do |count|
puts "this is the count #{count}"
end
精彩评论