Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardRubyblocks procs lambdas bindingSingle-choice MCQ

A `Binding` is captured inside a method whose local has gone out of scope. What do these prints show about how bindings reference scope?

def scope secret = 42 binding end b = scope p b.local_variable_get(:secret) b.local_variable_set(:secret, 100) p b.eval("secret")