Skip to main content
added 74 characters in body
Source Link
Alnitak
  • 340.8k
  • 72
  • 420
  • 503

As it happensAt the time of writing, most browsers dodid return properties in the same order as they were inserted, but it iswas explicitly not guaranteed behaviour so you should not relyshouldn't have been relied upon it.

In particular see section 12.6.4 of theThe ECMAScript specification used to say:

The mechanics and order of enumerating the properties ... is not specified.

However in ES2015 and later non-integer keys will be returned in insertion order.

As it happens, most browsers do return properties in the same order as they were inserted, but it is explicitly not guaranteed behaviour so you should not rely upon it.

In particular see section 12.6.4 of the ECMAScript specification:

The mechanics and order of enumerating the properties ... is not specified.

At the time of writing, most browsers did return properties in the same order as they were inserted, but it was explicitly not guaranteed behaviour so shouldn't have been relied upon.

The ECMAScript specification used to say:

The mechanics and order of enumerating the properties ... is not specified.

However in ES2015 and later non-integer keys will be returned in insertion order.

added 41 characters in body; deleted 3 characters in body
Source Link
Alnitak
  • 340.8k
  • 72
  • 420
  • 503

As it happens, in most browsers do return properties in the answer is "yes"same order as they were inserted, but it is explicitly not guaranteed behaviour so you should not rely upon it.

In particular see section 12.6.4 of the ECMAScript specification:

The mechanics and order of enumerating the properties ... is not specified.

As it happens, in most browsers the answer is "yes", but it is explicitly not guaranteed behaviour so you should not rely upon it.

In particular see section 12.6.4 of the ECMAScript specification:

The mechanics and order of enumerating the properties ... is not specified.

As it happens, most browsers do return properties in the same order as they were inserted, but it is explicitly not guaranteed behaviour so you should not rely upon it.

In particular see section 12.6.4 of the ECMAScript specification:

The mechanics and order of enumerating the properties ... is not specified.

added 24 characters in body
Source Link
Alnitak
  • 340.8k
  • 72
  • 420
  • 503

As it happens, in most browsers the answer is "yes", but it'sit is explicitly not guaranteed behaviour so you should not rely onupon it.

In particular see section 12.6.4 of the ECMAScript specification:

The mechanics and order of enumerating the properties ... is not specified.

As it happens, in most browsers the answer is "yes", but it's explicitly not behaviour you should rely on.

In particular see section 12.6.4 of the ECMAScript specification:

The mechanics and order of enumerating the properties ... is not specified.

As it happens, in most browsers the answer is "yes", but it is explicitly not guaranteed behaviour so you should not rely upon it.

In particular see section 12.6.4 of the ECMAScript specification:

The mechanics and order of enumerating the properties ... is not specified.

Source Link
Alnitak
  • 340.8k
  • 72
  • 420
  • 503
Loading