It's obvious that I can't rely on the ordering of key-value pairs in JSON. For example, a JSON parser could interpret
{
"someKey" : "someValue",
"anotherKey" : "anotherValue",
"evenAnotherKey" : "evenAnotherValue"
}
as
{
"anotherKey" : "anotherValue",
"someKey" : "someValue",
"evenAnotherKey" : "evenAnotherValue"
}
legally, but could I rely on the ordering of a JSON array? For example, could a JSON parser interpret
{
"arrayKey" : ["firstElement", "secondElement", "thirdElement"]
}
as
{
"arrayKey" : ["secondElement", "firstElement1", "thirdElement"]
}
legally? I'd assume not, but my friend told me that I was incorrect.