DEV Community

Discussion on: Stop Console.Logging! This is How to Use Chrome to Debug JavaScript

songthamtung profile image
songthamtung Author

Thanks for reading Antonio!

On the contrary, console.log() is actually not useful for async functions since it is non-blocking i.e. the result would be pending. If you want to console.log() async code, you would have to either precede the method with await or chain it with then. In this scenario, a breakpoint would be more efficient.

For readers who are unaware:

An asynchronous call requests a transfer that will be performed in its whole(entirety) but will complete at some future time.

Nevertheless, I do agree that printing some info into the console without stopping the code execution each time is useful depending on the situation.