I have been meaning to read the entire ECMA5-6 spec, cough, but maybe y'all can help me instead!
Can a variable be changed from "the outside" over the course of execution of a single call in JavaScript?
Pseudo-javascript example:
window.foo = true;
startSomeLoopMutatingFoo();
function f() {
var a = window.foo;
// Insert long, blocking work here, none of which mutates window.foo
var b = window.foo; // again
if (a != b) { totalMindExplosion() }
}
Will my mind be blown? Could totalMindExplosion() be called under any conceivable circumstance?
Here's a JS fiddle to facilitate mind fracking: http://jsfiddle.net/Mf3rc/
I'm looking for resources to learn about when asynchronous methods are executed, direct answers, or questions of clarity.
Thanks SO!