I am using websocket libarary for creating some sockets to pass data to my application.some where in my code i wrote following line.
connection.on('message', function(message)
{
SetOfInstruction1;
SetOfInstruction2;
});
My doubt is : Is SetOfInstruction1 and SetOfInstruction2; execute in sequence or they execute in a Asynch manner(it means setOfInstruction2 can excute before setOfInstruction1) ????
following are example of SetOfInstruction1 and SetOfInstruction2:
Example SetOfInstruction1
for (i 1 to n)
{
find something1 in something2 array
if something1 found then set found boolean to true else false;
}
Example for SetOfInstruction2 is
for (i:1 to n)
{
if found =true; and someOtherConditions matches
send message back with true response
else{
//continue
}
}