A scene from the movie Nosferatu 1922

Understanding ‘Variable Shadowing’ with JavaScript

Mayumi Nishimoto
5 min readApr 25, 2020

--

What is ‘variable shadowing’ and why it should be avoided.

Before we go straight to the definition, it is important to observe that a more comprehensive understanding of variable shadowing requires knowledge of two other fundamental programming concepts. Firstly, the importance of naming variables and, secondly, local variables and scoping rules.

--

--

Mayumi Nishimoto

Software Engineer in tireless pursuit of improving my craft and in a journey to learn by sharing with the community.