Advanced
Ruby
Q93 / 100
What does "Kernel#binding" return and how is it commonly used?
Correct! Well done.
Incorrect.
The correct answer is B) It returns a Binding object encapsulating the current execution context (local variables, self, etc.), which can later be used with eval to execute code in that captured context, useful for debugging tools
B
Correct Answer
It returns a Binding object encapsulating the current execution context (local variables, self, etc.), which can later be used with eval to execute code in that captured context, useful for debugging tools
Explanation
binding captures the current scope (variables, self, method visibility context) as an object, which tools like debuggers (e.g. byebug, pry) use to evaluate expressions as if running at that exact point in the code.
Progress
93/100