FRONTEND·중요도 6·2026. 05. 09.

JavaScript specified tail call optimization in ES2015. Most engines never implemented it, and your tail-recursive code can still blow the stack.

── KO ──────────────────

ES2015의 꼬리 호출 최적화가 구현되지 않아 재귀 호출이 스택을 초과할 수 있다.

ES2015에서 규정한 꼬리 호출 최적화는 대부분의 엔진에서 구현되지 않았다. 이로 인해 개발자들은 꼬리 재귀적인 코드를 작성하더라도 여전히 스택 오버플로우 문제를 경험할 수 있다. 이는 재귀 프로그래밍이 안정적이지 않을 수 있다는 것을 의미한다.


── EN ──────────────────

Tail call optimization in ES2015 is not implemented in most engines, risking stack overflow with tail-recursive code.

According to ES2015 specifications, tail call optimization was intended to improve recursive function calls. However, most JavaScript engines have not implemented this feature, which means that developers can still encounter stack overflow issues even with tail-recursive code. This highlights the need for caution when using recursion in JavaScript.

원문 보기 →목록으로