Board Thread:JS Development/@comment-9605025-20191030060753/@comment-9605025-20191206183509

Okay, new question but still related to asynchronous requests. I think I know the answer but just wanted to verify since I am having trouble searching for it online. Just out of curiosity, I tried putting together some JS to see how complicated it would be to use api.php to parse wikitext. I ended up having the following in the script. As you can see, I am using jQuery's  function and have provided an anonymous callback (let's call it anon1). Anon1 then calls  and provides another anonymous callback (let's call it anon2). Anon2 attempts to access the element passed to anon1. Assuming the element has not been removed, is the element that anon2 operates on guaranteed to be the one passed to anon1 for a given execution of anon1?

I tested the entire script out and it seems to work. However, I want to get some verification that the result is not just a race condition that happens to turn out the way I expect.

In case it matters, the script is here and the test is here.