@sebmck Hey man, quick question: always thought object spread kept the creation order but https://babeljs.io/repl/#?experimental=true&evaluate=true&loose=true&spec=false&code=let%20vals%20%3D%20%7B%2213%22%3A%20true%2C%20%2225%22%3A%20true%7D%3B%0Alet%20vals2%20%3D%20%7B%0A%20%20...vals%2C%0A%20%20%2212%22%3A%20true%0A%7D%3B%0A%20%20%0Aconsole.log(vals2)%3B%0Aconsole.log(Object.keys(vals2))%3B%0A … Am I missing something?
@bsansouci Creation order isn't how object keys are sorted. Let me find a spec reference.
-
-
@sebmck Ok cool, good to know. Thanks! So no way to force the order? -
@bsansouci Nope. You shouldn't really be relying on it either since it'll break depending on the implementation as some differ.
End of conversation
New conversation -
-
-
@bsansouci Object key order was only specified in ES2015. Previously it wasn't specified and implementations differed http://www.ecma-international.org/ecma-262/6.0/index.html#sec-ordinary-object-internal-methods-and-internal-slots-ownpropertykeys …Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
he/him 