I'm very new to Javascript and somewhere i found this code
var myObject = {
value: 0,
increment: function (inc) {
this.value += typeof inc === 'number' ? inc : 1;
}
};
In the above object the increment function is acessing the value variable using this. But in languages like java, the public method can access the private member without this also.. why it is not possible here?