sort keys with JSON.stringify()
bkardell at gmail.com
Mon Sep 12 08:07:32 PDT 2011
But Doug, just to clarify: You mean that the parsed objects create no
predictable insertion order right? It is actually possible to use replacer
to serialize keys in a particular order, and that might be enough for what
he is looking for (if two objects serialized as the same string they would
Perhaps I am over simplifying his question or I misunderstand your response.
On Sep 11, 2011 3:05 PM, "Douglas Crockford" <douglas at crockford.com> wrote:
> On 11:59 AM, Felipe Gasper wrote:
>> Is it possible to get sorted keys:
>> …from running JSON.stringify when declaring an object thus:
> JSON objects are unordered. If order is important, then use an array.
> es-discuss mailing list
> es-discuss at mozilla.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss