DEV Community

Discussion on: Block scope in javascript

Collapse
 
aishanipach profile image
Aishanii

Attached the wrong screenshot, I was playing around with the function example as well, which I mentioned too. Mistake on my end. Thank you for correcting!

Collapse
 
badgamerbad profile image
Vipul Dessai

No problem, happy to help, also i forgot to mention, in the quote at the end, the variable names have to the same in that example to give a syntax error, however it wouldn't be shadowing effect anymore, as they become part of the same scope.

Thread Thread
 
aishanipach profile image
Aishanii

Thank you so much for your help and correcting me. So much to learn!