Yes, the difference is in how the variable is stored.
The variable declared with var
is local to the constructor function. It will only survive beyond the constructor call if there is any function declared in the scope, as it then is captured in the functions closure.
The variable declared with this.
is actually not a variable, but a property of the object, and it will survive as long as the object does, regardless of whether it's used or not.
Edit:
If you are using variables without declaring them, they will be implicitly declared in the global scope, and not part of the object. Generally you should try to limit the scope for what you declare, so that not everything end up in the global scope.