Code
Loading editor...
Tap Analyze to see visualization
Click Analyze to visualize
See step-by-step execution, variables, and output
Variables
Run code to see variables
Output
Console output will appear here
Click Analyze to visualize
See step-by-step execution, variables, and output
Run code to see variables
Console output will appear here
Attach the target function as a temporary method on the context object using a Symbol key to avoid property collisions. Invoke it via context[fnKey](...args) so that this resolves to context, then clean up by deleting the temporary property.
When a function is called as a method of an object (obj.fn()), JavaScript sets this to the object. By temporarily attaching the function to the desired context, we leverage implicit this binding.
Updated Feb 2026