I don't know what is the difference between using 'do..end' and '{}'.
When I use 'do..end' below, it gives me error :368:in `each': no block given (LocalJumpError)
p [50, 17, 1, 22].inject do |acc, el|
if el < acc
el
else
acc
end
end
However, When I use '{}' below, it prints '1' the minimum value.
p [50, 17, 1, 22].inject { |acc, el|
if el < acc
el
else
acc
end
}
Is it because of the difference of 'precedence'?