A brief review of Scoping and Hoisting in JavaScript
Tiago Romero Garcia
7776

Is it because the function total is not overwritting the variable total as it’s scoped in the forEach function? Or does it have something to do with forEach itself (it might be async as someone pointed out above)? Interesting…

Like what you read? Give Dawid Zbiński a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.