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

In V8 (Node, Chrome), a self-recursive function is written so the recursive call sits in syntactic tail position under 'use strict'. What actually happens when it recurses deeply, and why?

'use strict'; function count(n) { if (n === 0) return 'done'; return count(n - 1); // syntactic tail position } count(1e6);