I'm learning JavaScript and while going through the concept of hoisting along with a few problems, I found out that the same code returns different results in VS code and in the window console. Please go through the snaps below
What can be the reason for this difference and what exactly is the correct solution?