News for hackers. Stuff that matters.
Re:Overview of JavaScript ES6 features by Roboprog on Wednesday October 26, 2016 @11:31AM (#12797264)
Javascript (in browser) is async, but not concurrent (like say, threads). JS will run the code in an event handler to completion (or not - while(1){}) before starting the code for the next event. Thus, code from one execution path cannot update variables in another path "immediately".

You could use a variable in a callback for an event that was assigned on the line above, and it since has changed, but it's important to remember that the callback (or promise, etc) does not actually run until an arbitrary time "later".

There are no comments on this comment yet.