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
Repeatedly invoke the value while it is a function, replacing it with the return value each time. Continue until the result is no longer a function, then return the final non-function value. Also implement a recursive variant that achieves the same result through self-calls.
A thunk is a nullary function wrapping a deferred value, so repeatedly calling it peels away each layer of indirection until the underlying value is reached.
Updated Feb 2026