as mentioned, we have the following business requirements
var x=[];
function A(){
X
}
function B(){
X
}
I"m worried now, because both function An and B are dealing with X. if there is a run-time crossover, it will cause some code logic problems.
in a database, it is generally in the form of a locked table to prevent X from being modified by both operations at the same time.
but in JS, is there any way to avoid this?
or, in other words, the way the JS code runs, this will not happen at all. It is certain that the complete code block will run before the next code block will be run.
Thank you