with var a you cant access the variable outside the scope however assigning with this can be accessed when you make an object
We add properties to this when we want the properties to exist with the life of the object.We Use var for local variables.
"I am ONLY interested in accessing variables from inside the object,
not from outside."
Answer to this statement is use var if you want to use only inside the function not outside as variable defined with var are accessible only to code in the scope in which they were declared, or in lexically nested scopes.
so as Shomz suggested you can check it as:
var o = new MyObject();
a will be undefined as it is defined with var
o.a; // undefined
while b will be return 2 as it is on this
o.b; // 2