How to prevent sorting of the object by adding new properties to it?
How to prevent sorting of the object by adding new properties to it? The keys are integers. And if there was some kind of key 10 when the key is added 5 he stands in front of him. How can it be prevented?
any way, the order of the keys in the object in General is not guaranteed, depends on the implementation in the engine, and tomorrow 5 could recite added after 10 and 10 to get up before 5. or suddenly your code will run on a v8 and not some other engine where it is not so.
Want guaranteed to iterate over keys in the order they were added - use an array or something else suitable.