3 ms·
Just FYI, since I assume it doesn't come up in the lessons, your REPL doesn't like objects that self-reference, even though it isn't trying to print them out.
by Cushman 15y ago
Just FYI, since I assume it doesn't come up in the lessons, your REPL doesn't like objects that self-reference, even though it isn't trying to print them out.
> o = {}
> o.o = o
==> [object Object]
ERROR: Maximum call stack size exceeded
This isn't totally unusual; `window` has several self-references, for example, and hangs for several seconds.
- amasad 15y ago@zds inspect.js should fix this issue, which was written by the Node people to inspect objects in the terminal and take care of circular references. I edited it to make it work on the web https://github.com/amasad/jsrepl/blob/master/util/inspect.js https://github.com/amasad/jsrepl/blob/master/util/inspect.js Just pass all results from eval to the inspect function and you'll get a nice pretty printed output!
- zds 15y agothanks, amasad. looking into this now!