| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Errors/Too_much_recursion | [Back] [Original] |
Get to know MDN better
JavaScript "too much recursion" "Maximum call stack size exceeded"
RangeError: Maximum call stack size exceeded (Chrome) InternalError: too much recursion (Firefox) RangeError: Maximum call stack size exceeded. (Safari)
InternalError (Firefox) RangeError (Chrome Safari)
() JavaScript
10
function loop(x) {
if (x >= 10)
// "x >= 10"
return;
//
loop(x + 1); //
}
loop(0);
function loop(x) {
if (x >= 1000000000000) return;
//
loop(x + 1);
}
loop(0);
// InternalError: too much recursion
function loop(x) {
//
loop(x + 1); //
}
loop(0);
// InternalError: too much recursion
class Person {
constructor() {}
set name(name) {
this.name = name; //
}
}
const tony = new Person();
tony.name = "Tonisha"; // InternalError: too much recursion
name (this.name = name;) JavaScript
**
class Person {
get name() {
return this.name; //
}
}
class Person {
constructor() {}
set name(name) {
this._name = name;
}
get name() {
return this._name;
}
}
const tony = new Person();
tony.name = "Tonisha";
console.log(tony);
| Web Proxy Viewer | New URL | Original Page |