The javascript’s execution is fast. The fetch is a promise. Codes in then method only execute when the promise is fulfill. But the code under it got executed if the promise is fulfilled or not.
For example:
In a class students are writing stories. And the teacher tell them to come to her when she call. So students are listening to her but still writing stories before the teacher call them. And if teacher call them they go to her.
You can wrap the loop/logging code inside a function that you call inside the async code after the push. Or you can just pass the data to the function.