5 ms·
FWIW, the thing that was confusing here didn't really have anything to do with async/await: it was all thanks to +=... which was hilariously also the source of
by saurik 8y ago
FWIW, the thing that was confusing here didn't really have anything to do with async/await: it was all thanks to +=... which was hilariously also the source of a major issue recently found in Java 9/10. I am honestly starting to become a bit terrified of += :(.
https://news.ycombinator.com/item?id=17238015 https://news.ycombinator.com/item?id=17238015
- he0001 8y agoThey are not equivalent scenarios, which the article explains. The JS one is about asynchronous isolation context while the java one is just a evaluation bug.
- AntonyGarand 8y agoWell, considering `x = x + await 2` and `x = await 2 + x` produces different behavior, it is more related to async/await than to the `+=` operator!