It seems like JavaScript has ordered keys. Notice that the order of keys are based on insertion order.

> obj = {};
> obj.zulu = 1;
> obj.yankee = 1;
> obj.xray = 1;
> obj
{ zulu: 1, yankee: 1, xray: 1 }

You can add more keys to an object, and it’ll always end up in the end.

> obj.bravo = 1;
> obj.alpha = 1;
> obj
{ zulu: 1, yankee: 1, xray: 1, bravo: 1, alpha: 1 }

Not really

But there are special cases when the key is a string that is a number. Notice this puts the new key at the beginning:

> obj['5'] = 1;
> obj
{ '5': 1, zulu: 1, yankee: 1, xray: 1, bravo: 1, alpha: 1 }

This is only true for numbers-as-strings. Strings that begin with numbers aren’t affected.

> obj['5X'] = 1;
> obj
{ '5': 1, zulu: 1, yankee: 1, xray: 1, bravo: 1, alpha: 1, '5X': 1 }

Sorting behavior

The number-like keys are going to be sorted numerically (not lexically) before the other keys.

> obj = {};
> obj.y = 1;
> obj.x = 1;
> obj['22'] = 1;
> obj['5'] = 1;
> obj['2'] = 1;
> obj
{ '2': 1, '5': 1, '22': 1, y: 1, x: 1 }

Hat tip to @cheeaun for the observation on the behavior of numeric sorting!