I am using ArcGIS JS API version 3.6. I want to make query task synchronize. While executing query task reaming code will wait until completion of query task.
For example I have shared my code here which contains query layer.
Case 1: In which I am directly executing the code and printing the log in console window, where you can see before the query task output is displaying
Case 2: In this case we have used alert (for time delay) in the code then value is getting before query task.
-Researching on Google and going through similar question
Case 1 screenshot :
Case 2 screenshot :
Any help will be great !!! thanks in advance : )