I've seen quite a few questions about exection order issues in JavaScript involving ajax calls.
If there are no ajax calls, is it safe to assume that code will execute from top to bottom?
Say, I have this code below. None of the functions that I'm calling have any async calls in them.
someFunction() {
// Call some external function
doSomething();
// Then call another external function
const x = doSomethingElse();
if(x === 0) {
// Call third function
thirdFunction();
}
}
Currently, I'm running into a situation where it appears as if doSomething() is not getting called first. Is this possible?
P.S. I'm having this issue in a React/Redux app and doSomething() is an action that is supposed to reset/clear something in the store but currently that's not working.
doSomething()first. So the order seems OK but for some reason, the code is not hitting the reducer. So, it's a different issue. Thanks!