— For strings, as an example, you can get total order just via alphabetic sorting order
— Why not use an array of key/value pairs
— If you have control of that data structure, that is...
—
[
{myKey: myValue},
...
]
or
[
[myKey, myValue],
...
]
— Otherwise, imperative access is probably more readable
— Or, at that rate, you might just be better off using a map
— Since that's what a map is