Relying on object property order for a styling API. Good or bad? eg. styles({ backgroundBlue: true, backgroundRed: true, }); In this case the background would be `red` as it appears last. Relying on property order feels gross but can't think of a better API?
-
Show this thread
-
Replying to @sebmck
Is the key order guaranteed? https://stackoverflow.com/questions/5525795/does-javascript-guarantee-object-property-order …
1 reply 0 retweets 4 likes -
Replying to @Kerumen
That SO question is very wrong. JavaScript has guaranteed object property order for years.
2 replies 0 retweets 5 likes -
Replying to @sebmck
Good to know! Do you have any resources to prove your point? Always nice to have some docs to refer to when someone is asking you the same question.
1 reply 0 retweets 2 likes
Replying to @Kerumen
Sebastian Retweeted Sebastian
Sebastian added,
SebastianVerified account @sebmck
Want to clarify a common misconception that JS does not have a guaranteed property order. It does. In fact it was standardised in ES2015. Before that it was a pseudo-standard among most engines. See https://tc39.github.io/ecma262/#sec-ordinaryownpropertykeys …
Show this thread
11:46 AM - 16 Oct 2018
0 replies
0 retweets
7 likes
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 