Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardJavaScripttail-call behaviorSingle-choice MCQ

Mutual recursion written with tail calls runs on an engine WITHOUT proper tail calls. What is the precise failure mode, and how does a trampoline fix it at the runtime level?

const isEven = n => n === 0 ? true : isOdd(n - 1); const isOdd = n => n === 0 ? false : isEven(n - 1); isEven(1e6); // without PTC