{
c1:[],
c2:[],
c3:[],
c4:[],
c5:[] // This key value pair should be positioned after c2
}
How do I change the position of "c5" to be after "c2"
{
c1:[],
c2:[],
c3:[],
c4:[],
c5:[] // This key value pair should be positioned after c2
}
How do I change the position of "c5" to be after "c2"
Relying on order of properties is often avoided because though browsers behave in the same way in the common cases, the behavior is not guaranteed for edge cases. Understanding those cases is not an easy task.
Sugestion
Use an array of key/value pairs. An array is a natural way to indicate order. Using indexes from a literal definition is not that common or natural.
[{key: 'c1', value:[]}, {key: 'c2', value:[]}]
You probably already know how to answer your original question if you do that.