I am bit baffled about the below behavior
if true
foo = "true"
end
if false
bar = "false"
end
foo # => "true"
bar # => nil
buzz # =>
# ~> -:11:in `<main>': undefined local variable or method `buzz' for main:Object (NameError)
I expect bar to throw a NameError but it does not, I actually hit this when I was playing around with some friends but nobody could give a clear explanation to this behavior, thanks in anticipation of a clear answer