Is there a way to display the result of a JS function MIDWAY during execution ? instead of the return result?

If the title is not clear…I have BIG function that I want its return value. But I also wanted to get what it’s doing in the middle of the execution. I can see that by doing console.log…but is there a way to capture that and display it in the HTML ? Thanks