Hacker News new | ask | show | jobs
by foota 2375 days ago
This is not the case, if your callback then goes off and does something asynchronous.
1 comments

Yes sorry I was thinking in terms of code that uses callbacks, not the async keyword.

What I mean is that distinct from threading, where the following code could be interrupted between the first and second line of the function, by something that updates global:

    var global

    function addTheseToGlobal(a, b) {
      im = a + global
      return im + b
    }