4 ms·
Is there such a thing as a non-string JSON key to be evaluated? https://www.json.org/ https://www.json.org/ suggests not.
by gmfawcett 3y ago
Is there such a thing as a non-string JSON key to be evaluated? https://www.json.org/ https://www.json.org/ suggests not.
- ash 3y agoYes, in the context of JSON handling by JavaScript. I meant string keys that can be interpreted as non-negative numbers. Those are traversed first, the rest of the keys are coming in insertion order. For example: > JSON.stringify({'one': 1, '3': 3, 'two': 2, '2': 2, 'three': 3, '1': 1}) '{"1":1,"2":2,"3":3,"one":1,"two":2,"three":3}'
- gmfawcett 3y agoThanks for explaining. That behaviour is... interesting!