Doing some refactoring, I noticed an unusual pattern I'm not familiar with. Properties and variables that do not yet have a value are initiated with undefined declared explicitly, despite the fact that value-less variables and object properties would evaluate to undefined anyways:var foo = undefined;this.prop = undefined;Is there a reason to do this?
Initializing a variable as undefined
javascript
It's possible the author came from an environment where all variables were required to be initialized when declared. Some code-checking tools will also complain if variables are not initialized before they are used (even if the first use is to assign a value).