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.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
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:
Nevertheless, I do agree that printing some info into the console without stopping the code execution each time is useful depending on the situation.