js NSIS Objective-C Pascal Perl PHP PHP.Can I block the for loop execution to wait for removal to finish? If 1 is not possible then how do I achieve this use case? A promise is an object that represents an asynchronous computation that eventually will complete.This is a quite heavy operation and we dont want to stick around waiting for the result. So instead we want to execute it in a promise - making the function run asynchronously. Now I want each function to finish completely before the next function happens. With function A and B I can use a callback easily enough.here we wait until the event was received (this could already happen before A or B are finished. .then(() > C()) .