[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Errors/Too_much_recursion [Back]  [Original]

InternalError: too much recursion - JavaScript | MDN

This page was translated from English by the community. Learn more and join the MDN Web Docs community.

View in English Always switch to English

InternalError: too much recursion

    InternalError: too much recursion

In this article

InternalError.

?

. , . , ( , ) . , JavaScript .

exit 10 .

js
function loop(x) {
  if (x >= 10) {
    // "x >= 10" is the exit condition
    return;
  }
  // do stuff
  loop(x + 1); // the recursive call
}
loop(0);

.

js
function loop(x) {
  if (x >= 1000000000000) return;
  // do stuff
  loop(x + 1);
}
loop(0);

// InternalError: too much recursion


Web Proxy Viewer  |  New URL  |  Original Page