Array.prototype.join with cycles
brandon at brandonbenvie.com
Mon Dec 24 08:32:52 PST 2012
I meant JSON.stringify explicitly specifies how to handle cycles.
On Monday, December 24, 2012, Brandon Benvie wrote:
> Given the following:
> var x = [1,2,3];
> What should happen? The behavior demonstrated by V8, Spidermonkey, and
> Chakra (haven't tested others) is to return the empty string for cycles,
> thus returning the result '1,2,3,'. However, unless I'm missing something,
> this behavior is unspecified and an equally valid result would be to
> infinitely loop or throw a recursion error.
> For comparison, JSON.stringify explicitly specifies how to handle
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss