How to make node js to wait for function to execute (even if it take time) and then execute the next statement . for me problem is for loop prints all urls first it does nt wait for require request function to check each url the http response. It just prints all urls. beacuse of this i am getting the errorHow to make node js to wait for function to exe