You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

17 lines
217 B

var ob = {};
var max = 5230; // just before call stack breaks
var count = 0;
function g(o) {
if (count++ < max) {
o.k = {};
g(o.k);
}
else {
o.k = 'cool';
}
}
g(ob);
console.log(JSON.stringify(ob));