1

I understand that in JS Object keys aren't guaranteed to be ordered.

However, I find that for object literals the order, after creation, remains equal to the literal unless I add a new key.

Could I rely on the key ordering of an object literal I freeze?

For instance:


const o = Object.freeze({
    a: 1,
    b: 2,
    c: 3
});

What are the conditions under which the order of this object's keys wouldn't be a,b,c?

Pablo Barría Urenda
  • 4,664
  • 4
  • 15
  • 27

0 Answers0