Do Browsers cause Interrupts to their JS when receiving a response?
Assume, for whatever reason, that we have three inline scripts on a page. Each of these scripts are functionally the same, and all three will create a script tag, with the source set to a server-side script (each with slightly different parameters) which returns JS to execute. Assume this JS contains a global variable containing important parameters for the function it calls at the end.

    var g_important = {"arbitrary1":"someval1", "arbitrary2":"someval2"};
    doSomething();

The script in question resides on a CDN with a load balancer. Assume that each request from our original JS could actually be sent to a different server. The response time from the server is now variable, meaning we might get our response to the second request first. That's not a problem because we send a reference value back with the code, ensuring that we're at least working with the specified object.

My question is: what happens when we get two responses at roughly the same time? This is a very unlikely case, but if the first response is in the process of executing doSomething() when the second response comes in, what does the browser do? Does it parse the value for the variable and push the second doSomething call onto the stack?

Assuming this is the case, doSomething could be working with the wrong set of values ***in theory***. I can't recreate this case, as the timing would have to be absolutely perfect, but I need to know if it's a problem.
Do Browsers cause Interrupts to their JS when receiving a response?
===

Assume, for whatever reason, that we have three inline scripts on a page. Each of these scripts are functionally the same, and all three will create a script tag, with the source set to a server-side script (each with slightly different parameters) which returns JS to execute. Assume this JS contains a global variable containing important parameters for the function it calls at the end.

    var g_important = {"arbitrary1":"someval1", "arbitrary2":"someval2"};
    doSomething();

The script in question resides on a CDN with a load balancer. Assume that each request from our original JS could actually be sent to a different server. The response time from the server is now variable, meaning we might get our response to the second request first. That's not a problem because we send a reference value back with the code, ensuring that we're at least working with the specified object.

My question is: what happens when we get two responses at roughly the same time? This is a very unlikely case, but if the first response is in the process of executing doSomething() when the second response comes in, what does the browser do? Does it parse the value for the variable and push the second doSomething call onto the stack?

Assuming this is the case, doSomething could be working with the wrong set of values ***in theory***. I can't recreate this case, as the timing would have to be absolutely perfect, but I need to know if it's a problem.