Proper way to wait for one function to finish before continuing?

One way to deal with asynchronous work like this is to use a callback function, eg: As per @Janaka Pushpakumara’s suggestion, you can now use arrow functions to achieve the same thing. For example: firstFunction(() => console.log(‘huzzah, I\’m done!’)) Update: I answered this quite some time ago, and really want to update it. While callbacks are … Read more