10. What is a Block?


#1

In #10, what is the block?

Is it the entire code?

["ryan", "jane"].each {|string| puts "#{string[0].upcase}#{string[1..-1]}"}

or just the ["ryan", "jane"]

or other?

I'm a bit confused. Thanks in advance!


#2

Or is it just

{|string| puts "#{string[0].upcase}#{string[1..-1]}"}

#3

The block is the { ... } portion that contains the iteration code. Internalized variables are the norm, as given by, |string| before the action statement.