That's exactly how Javascript works. The code you have supplied will guarantee that subscribePresence(); finishes executing before getValidationData(); is called. JavaScript executes code in order. Whether or not subscribePresence(); starts some other asynchronous task has nothing to do with it finishing its execution.
subscribePresence();finishes executing beforegetValidationData();is called. JavaScript executes code in order. Whether or notsubscribePresence();starts some other asynchronous task has nothing to do with it finishing its execution.subscribePresence()so we can see whether it is asynchronous or not and, if so, how to know when it is done with its work.