Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardRubyBinding objectsSingle-choice MCQ

You capture a binding from inside a method that also defined a closure over a local. Mutating that local through the binding and then calling the closure shows what?

def counter count = 0 inc = -> { count += 1 } binding end b = counter b.local_variable_set(:count, 41) b.local_variable_get(:inc).call