There are many stackoverflow questions related to (a)synchronous executions and promises, but I did not quite find an answer to this.
Imagine I have the following:
var number = 0;
someAsyncFunctionWithCallback(function(){
number++;
});
// ^ execute the above multiple times
As the execution times of each call of the function varies, the callbacks will be called at different times. Therefore, I am wondering what the behavior of the variable-incrementing line will be. In Java, I can declare variables as synchronous such that every increment will be taken into account. With the code above, is each increment of the number guaranteed, or not necessarily?
++increment or actual things that need to be chained or ordered