// immutable.js function deep(n) { var x = Immutable.List([n]); for(var i = 0; i < 10000; i++) { x = Immutable.List([x]); } return x; } var x = deep(2); var y = deep(2); console.log(x === y); // → false console.log(x.equals(y)); // → Uncaught RangeError: Maximum call stack size exceeded
// mori.js function deep(n) { var x = mori.list(n); for(var i = 0; i < 10000; i++) { x = mori.list(x); } return x; } var x = deep(2); var y = deep(2); console.log(x === y); // → false console.log(mori.equals(x,y)); // → Uncaught RangeError: Maximum call stack size exceeded
I guess it's too expensive to do that in practice?