factorial[0] = 1;
factorial[x_Integer?Positive] := factorial[x - 1]*x;
ResourceFunction[&quot;TraceInteractive&quot;][factorial[4], _factorial]